jgomezdans / get_modis

Downloading MODIS data from the USGS repository
GNU General Public License v3.0
62 stars 41 forks source link

downloading fails #6

Closed kalxas closed 7 years ago

kalxas commented 7 years ago

Hi, I am trying out this script and I am getting this response:

Traceback (most recent call last):
  File "./get_modis.py", line 331, in <module>
    verbose=options.verbose, ruff=options.quick)
  File "./get_modis.py", line 266, in get_modisfiles
    raise IOError("Can't start download... [%s]" % fname)
IOError: Can't start download... [MOD09A1.A2016105.h19v05.005.2016114072543.hdf]

Any ideas?

kalxas commented 7 years ago

I realized that I was using python2.7 instead of python3 for the above call. When switching to python3.4 I get the following:

Traceback (most recent call last):
  File "./get_modis.py", line 331, in <module>
    verbose=options.verbose, ruff=options.quick)
  File "./get_modis.py", line 249, in get_modisfiles
    if line.decode().find(tile) >= 0:
AttributeError: 'str' object has no attribute 'decode'
kalxas commented 7 years ago

After deleting the .decode() from the above lines, I got an ssl error, which I fixed by adding the following in L331:

r1 = s.request('get', the_url, verify=False)

So then I am back to error:

Traceback (most recent call last):
  File "./get_modis.py", line 331, in <module>
    verbose=options.verbose, ruff=options.quick)
  File "./get_modis.py", line 266, in get_modisfiles
    raise IOError("Can't start download... [%s]" % fname)
OSError: Can't start download... [MOD09A1.A2016097.h19v05.005.2016110032645.hdf]
kalxas commented 7 years ago

Perhaps this is relevant:

https://wiki.earthdata.nasa.gov/display/EL/How+To+Access+Data+With+Python

jgomezdans commented 7 years ago

Working well here with 2.7 (using 7ce07df53027a3a3f8753b4e8624ac247302c9b1). Remember that on Wednesdays the LPDAAC server goes down for a few hours...

kalxas commented 7 years ago

Just tested again (using the commit you proposed), same error with Python 2.7:

File "./get_modis.py", line 331, in <module>
    verbose=options.verbose, ruff=options.quick)
  File "./get_modis.py", line 266, in get_modisfiles
    raise IOError("Can't start download... [%s]" % fname)
IOError: Can't start download... [MOD09A1.A2016105.h19v05.005.2016114072543.hdf]

The username and password work fine when downloading from the web page. Is there something else I need to do with my account to make this work (like an extra setting or extra permissions)?

kalxas commented 7 years ago

My terminal line:

./get_modis.py -s MOLT -u username -P password -p MOD09A1.005 -t h19v05 -y 2016 -b 100 -e 107 -o ./ -v
kalxas commented 7 years ago

hi, I managed to fix this: It was a character in my password that caused the error. Works fine after changing the password.

kalxas commented 7 years ago

Thanks for your help

sylar11 commented 1 year ago

I don't know if this repo is still maintained but I'm getting this error:

./get_modis.py -s MOLT -u myuser -P mypaswd -p MOD09GA.061 -t h18v04 -y 2022 -b 223 -e 224 -o ./ -v https://e4ftl01.cr.usgs.gov/MOLT/MOD09GA.061/ ('them_urls', []) <Response [401]> Traceback (most recent call last): File "./get_modis.py", line 327, in get_xml=options.get_xml) File "./get_modis.py", line 258, in get_modisfiles raise IOError("Can't start download... [%s]" % the_url) IOError: Can't start download... [https://e4ftl01.cr.usgs.gov/MOLT/MOD09GA.061//2022.08.11/MOD09GA.A2022223.h18v04.061.2022225035300.hdf]

any suggestions?