pyModis
pyModis copied to clipboard
not downloading anything
trying to download over h30v08 tile for 2016, but seems to me it's not downloading anything. The log file continues to increase in size (more logs) but the download for first tile does not move more than 0 bytes, and it seems to me that download is failing, and it tries to download again (the loop conitnues). Any advise? Been using pymodis for a long time now, but I changed my computer and reinstall again. I am using pymodis 1.0 and using the latest package of pymodis in PyPi. here is a sample of the content of the log file:
2016-10-09 15:45:41,039 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-10-09 15:45:41,091 - ERROR - Error in connection 2016-10-09 15:45:41,091 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-10-09 15:45:41,154 - ERROR - Error in connection 2016-10-09 15:45:41,154 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-10-09 15:45:41,191 - ERROR - Error in connection 2016-10-09 15:45:41,191 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-10-09 15:45:41,892 - DEBUG - "GET /MOLT/MOD13Q1.005 HTTP/1.1" 301 252 2016-10-09 15:45:42,193 - DEBUG - "GET /MOLT/MOD13Q1.005/ HTTP/1.1" 200 None 2016-10-09 15:45:43,342 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-10-09 15:45:43,828 - DEBUG - "GET /MOLT/MOD13Q1.005/2016.06.25 HTTP/1.1" 301 263 2016-10-09 15:45:44,865 - DEBUG - "GET /MOLT/MOD13Q1.005/2016.06.25/ HTTP/1.1" 200 None 2016-10-09 15:45:46,346 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-10-09 15:45:46,901 - DEBUG - "GET /MOLT/MOD13Q1.005/2016.06.25/MOD13Q1.A2016177.h30v08.005.2016200071432.hdf HTTP/1.1" 302 520 2016-10-09 15:45:46,917 - INFO - Starting new HTTPS connection (1): urs.earthdata.nasa.gov 2016-10-09 15:45:50,795 - DEBUG - "GET /oauth/authorize?scope=uid&app_type=401&client_id=ijpRZvb9qeKCK5ctsn75Tg&response_type=code&redirect_uri=http%3A%2F%2Fe4ftl01.cr.usgs.gov%2Foauth&state=aHR0cDovL2U0ZnRsMDEuY3IudXNncy5nb3YvTU9MVC9NT0QxM1ExLjAwNS8yMDE2LjA2LjI1L01PRDEzUTEuQTIwMTYxNzcuaDMwdjA4LjAwNS4yMDE2MjAwMDcxNDMyLmhkZg HTTP/1.1" 401 None 2016-10-09 15:45:50,795 - ERROR - Cannot download MOD13Q1.A2016177.h30v08.005.2016200071432.hdf. Retrying... 2016-10-09 15:45:50,813 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-10-09 15:45:51,316 - DEBUG - "GET /MOLT/MOD13Q1.005/2016.06.25/MOD13Q1.A2016177.h30v08.005.2016200071432.hdf HTTP/1.1" 302 520 2016-10-09 15:45:51,316 - INFO - Starting new HTTPS connection (1): urs.earthdata.nasa.gov 2016-10-09 15:45:53,450 - DEBUG - "GET /oauth/authorize?scope=uid&app_type=401&client_id=ijpRZvb9qeKCK5ctsn75Tg&response_type=code&redirect_uri=http%3A%2F%2Fe4ftl01.cr.usgs.gov%2Foauth&state=aHR0cDovL2U0ZnRsMDEuY3IudXNncy5nb3YvTU9MVC9NT0QxM1ExLjAwNS8yMDE2LjA2LjI1L01PRDEzUTEuQTIwMTYxNzcuaDMwdjA4LjAwNS4yMDE2MjAwMDcxNDMyLmhkZg HTTP/1.1" 401 None 2016-10-09 15:45:53,467 - ERROR - Cannot download MOD13Q1.A2016177.h30v08.005.2016200071432.hdf. Retrying... 2016-10-09 15:45:53,467 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-10-09 15:45:54,082 - DEBUG - "GET /MOLT/MOD13Q1.005/2016.06.25/MOD13Q1.A2016177.h30v08.005.2016200071432.hdf HTTP/1.1" 302 520 2016-10-09 15:45:54,082 - INFO - Starting new HTTPS connection (1): urs.earthdata.nasa.gov 2016-10-09 15:45:56,523 - DEBUG - "GET /oauth/authorize?scope=uid&app_type=401&client_id=ijpRZvb9qeKCK5ctsn75Tg&response_type=code&redirect_uri=http%3A%2F%2Fe4ftl01.cr.usgs.gov%2Foauth&state=aHR0cDovL2U0ZnRsMDEuY3IudXNncy5nb3YvTU9MVC9NT0QxM1ExLjAwNS8yMDE2LjA2LjI1L01PRDEzUTEuQTIwMTYxNzcuaDMwdjA4LjAwNS4yMDE2MjAwMDcxNDMyLmhkZg HTTP/1.1" 401 None 2016-10-09 15:45:56,539 - ERROR - Cannot download MOD13Q1.A2016177.h30v08.005.2016200071432.hdf. Retrying... 2016-10-09 15:45:
@lpalao you have to install version 2.0. Version 1.0 is not supporting the new NASA authentication system.
Please update pyModis and let me know
I'm getting this same error (empty download files) and I'm on pymodis 2.0.2 (Python 3.5)
2016-12-14 13:06:29,677 - DEBUG - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-12-14 13:06:48,848 - DEBUG - http://e4ftl01.cr.usgs.gov:80 "GET /MOLT/MOD11A1.005 HTTP/1.1" 301 252 2016-12-14 13:06:49,991 - DEBUG - http://e4ftl01.cr.usgs.gov:80 "GET /MOLT/MOD11A1.005/ HTTP/1.1" 200 None 2016-12-14 13:06:57,819 - DEBUG - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-12-14 13:07:19,869 - DEBUG - http://e4ftl01.cr.usgs.gov:80 "GET /MOLT/MOD11A1.005/2016.11.01 HTTP/1.1" 301 263 2016-12-14 13:07:20,481 - DEBUG - http://e4ftl01.cr.usgs.gov:80 "GET /MOLT/MOD11A1.005/2016.11.01/ HTTP/1.1" 200 None 2016-12-14 13:07:42,286 - ERROR - Cannot download MOD11A1.A2016306.h09v05.005.2016307100736.hdf.xml. Retrying... 2016-12-14 13:08:07,564 - ERROR - Cannot download MOD11A1.A2016306.h09v05.005.2016307100736.hdf.xml. Retrying... 2016-12-14 13:08:23,915 - ERROR - Cannot download MOD11A1.A2016306.h09v05.005.2016307100736.hdf.xml. Retrying... 2016-12-14 13:08:44,003 - ERROR - Cannot download MOD11A1.A2016306.h09v05.005.2016307100736.hdf.xml. Retrying... 2016-12-14 13:09:07,509 - ERROR - Cannot download MOD11A1.A2016306.h09v05.005.2016307100736.hdf.xml. Retrying... 2016-12-14 13:09:39,360 - ERROR - Cannot download MOD11A1.A2016306.h09v05.005.2016307100736.hdf.xml. Retrying... 2016-12-14 13:09:58,341 - ERROR - Cannot download MOD11A1.A2016306.h09v05.005.2016307100736.hdf.xml. Retrying...
@jamieodonnell can you send your command line (without user password) ?
import os import glob from pymodis import downmodis WxPython missing, no GUI enabled dest = 'C:/PymodisDownloads/' tiles = 'h08v07,h09v07,h07v06,h08v06,h09v06,h07v05,h08v05,h09v05' day = "2012-06-01" delta = 1460 day = "2016-11-01" user = 'username' password = 'password' modisDown = downmodis.downModis(destinationFolder=dest, tiles=tiles, today=day, delta=delta, user = user, password = password) modisDown.connect() modisDown.downloadsAllDay()
I'm attempting to follow the iPython Notebook
@jamieodonnell for me it is working, maybe your user is not enabled to download from that site?
Please check the documentation and if you can download the data from the website
l /tmp/
-rw-r--r-- 1 lucadelu gis 500 Dec 15 12:31 modisMOD11A1.005.log
-rw-r--r-- 1 lucadelu gis 672K Dec 15 12:31 MOD11A1.A2016306.h07v06.005.2016307100707.hdf
-rw-r--r-- 1 lucadelu gis 6.9M Dec 15 12:31 MOD11A1.A2016306.h08v06.005.2016307100733.hdf
-rw-r--r-- 1 lucadelu gis 585K Dec 15 12:31 MOD11A1.A2016306.h09v07.005.2016307100728.hdf
-rw-r--r-- 1 lucadelu gis 9.4K Dec 15 12:31 MOD11A1.A2016306.h07v05.005.2016307100710.hdf.xml
-rw-r--r-- 1 lucadelu gis 8.8K Dec 15 12:31 MOD11A1.A2016306.h08v07.005.2016307100701.hdf.xml
-rw-r--r-- 1 lucadelu gis 8.8K Dec 15 12:31 MOD11A1.A2016306.h07v06.005.2016307100707.hdf.xml
-rw-r--r-- 1 lucadelu gis 0 Dec 15 12:31 MOD11A1.A2016306.h08v07.005.2016307100701.hdf
-rw-r--r-- 1 lucadelu gis 9.1K Dec 15 12:31 MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml
-rw-r--r-- 1 lucadelu gis 338 Dec 15 12:31 listfileMOD11A1.005.txt
Good afternoon, I am having the same trouble as @jamieodonnell. I have used the same command line as jaimeodonnell, for reproducibility, and I am using Python 2.7.6 and pymodis 2.0.2. I don't have any trouble downloading data from the website using your link above.
Traceback:
Traceback (most recent call last):
File "
(and so on), and Logfile:
2016-12-15 14:11:14,526 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-12-15 14:11:14,570 - DEBUG - Setting read timeout to 100 2016-12-15 14:11:14,611 - DEBUG - "GET /MOLT/MOD11A1.005 HTTP/1.1" 301 252 2016-12-15 14:11:14,612 - DEBUG - Setting read timeout to 100 2016-12-15 14:11:17,510 - DEBUG - "GET /MOLT/MOD11A1.005/ HTTP/1.1" 200 None 2016-12-15 14:11:18,706 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-12-15 14:11:18,751 - DEBUG - Setting read timeout to 100 2016-12-15 14:11:18,792 - DEBUG - "GET /MOLT/MOD11A1.005/2016.11.01 HTTP/1.1" 301 263 2016-12-15 14:11:18,793 - DEBUG - Setting read timeout to 100 2016-12-15 14:11:19,532 - DEBUG - "GET /MOLT/MOD11A1.005/2016.11.01/ HTTP/1.1" 200 None 2016-12-15 14:11:20,070 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-15 14:11:25,162 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-15 14:11:30,254 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-15 14:11:35,344 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-15 14:11:40,557 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-15 14:11:45,650 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-15 14:11:50,740 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying...
(etc.).
Many thanks, in advance! I really appreciate any insight you may be able to offer. -Miriam
I got it working in the end - turns out I hadn't capitalised one of the letters in my password.
Many thanks for testing @lucadelu and for your work on the plugin in general!
@mrjohnston I'm sorry but with 2.7.12 I'm not able to reproduce your error
Python 2.7.12+ (default, Nov 22 2016, 00:48:54)
Type "copyright", "credits" or "license" for more information.
IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import pymodis
In [2]: tiles = 'h08v07,h09v07,h07v06,h08v06,h09v06,h07v05,h08v05,h09v05'
...: day = "2012-06-01"
...: delta = 1460
...: day = "2016-11-01"
In [3]: user = 'myuser'
In [4]: passwd = 'mypass'
In [5]: dest='/tmp'
In [6]: modisDown = pymodis.downmodis.downModis(destinationFolder=dest, tiles=tiles, today=day, delta=delta, user = user, password = passwd)
In [7]: modisDown.connect()
In [8]: modisDown.downloadsAllDay()
ls /tmp
-rw-r--r-- 1 lucadelu gis 5.3M Dec 16 15:14 MOD11A1.A2016306.h08v05.005.2016307100724.hdf
-rw-r--r-- 1 lucadelu gis 9.0K Dec 16 15:14 MOD11A1.A2016306.h09v05.005.2016307100736.hdf.xml
-rw-r--r-- 1 lucadelu gis 5.8M Dec 16 15:14 MOD11A1.A2016306.h09v05.005.2016307100736.hdf
-rw-r--r-- 1 lucadelu gis 9.1K Dec 16 15:14 MOD11A1.A2016306.h09v07.005.2016307100728.hdf.xml
-rw-r--r-- 1 lucadelu gis 188K Dec 16 15:14 MOD11A1.A2016306.h07v05.005.2016307100710.hdf
-rw-r--r-- 1 lucadelu gis 9.1K Dec 16 15:14 MOD11A1.A2016306.h09v06.005.2016307100722.hdf.xml
-rw-r--r-- 1 lucadelu gis 8.8K Dec 16 15:14 MOD11A1.A2016306.h08v06.005.2016307100733.hdf.xml
drwxrwxrwt 23 root root 52K Dec 16 15:14 .
-rw-r--r-- 1 lucadelu gis 2.0M Dec 16 15:14 MOD11A1.A2016306.h09v06.005.2016307100722.hdf
-rw-r--r-- 1 lucadelu gis 384 Dec 16 15:14 listfileMOD11A1.005.txt
-rw-r--r-- 1 lucadelu gis 1.9K Dec 16 15:14 modisMOD11A1.005.log
Maybe it was a problem on the server? on Wednesday they usually do some maintenance works. Could you try again?
@jamieodonnell cool that you solve the problem!
@lucadelu I just tried again, and I didn't change anything except for the username & password from the test you just ran:
import pymodis tiles = 'h08v07,h09v07,h07v06,h08v06,h09v06,h07v05,h08v05,h09v05' day = "2012-06-01" delta = 1460 day = "2016-11-01" user = 'username' passwd = 'password' dest='/tmp' modisDown = pymodis.downmodis.downModis(destinationFolder=dest, tiles=tiles, today=day, delta=delta, user = user, password = passwd) modisDown.connect() modisDown.downloadsAllDay()
I receive the same errors:
2016-12-16 09:52:57,469 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-12-16 09:52:57,536 - DEBUG - Setting read timeout to 30 2016-12-16 09:52:57,606 - DEBUG - "GET /MOLT/MOD11A1.005 HTTP/1.1" 301 252 2016-12-16 09:52:57,608 - DEBUG - Setting read timeout to 30 2016-12-16 09:52:58,019 - DEBUG - "GET /MOLT/MOD11A1.005/ HTTP/1.1" 200 None 2016-12-16 09:52:59,203 - INFO - Starting new HTTP connection (1): e4ftl01.cr.usgs.gov 2016-12-16 09:52:59,248 - DEBUG - Setting read timeout to 30 2016-12-16 09:52:59,417 - DEBUG - "GET /MOLT/MOD11A1.005/2016.11.01 HTTP/1.1" 301 263 2016-12-16 09:52:59,418 - DEBUG - Setting read timeout to 30 2016-12-16 09:53:00,394 - DEBUG - "GET /MOLT/MOD11A1.005/2016.11.01/ HTTP/1.1" 200 None 2016-12-16 09:53:01,921 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-16 09:53:07,014 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-16 09:53:12,191 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-16 09:53:17,330 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying... 2016-12-16 09:53:22,444 - ERROR - Cannot download MOD11A1.A2016306.h08v05.005.2016307100724.hdf.xml. Retrying...
Do you think that it's possible that the issue is my version of Python, 2.7.6 (rather than 2.7.12)? Thanks again for your help!
@mrjohnston do you know a little bit of Python? I could help you in the debug because I'm not able to reproduce the error...
@lucadelu I'd really appreciate that; and I know a little bit but I'm just starting (natively an R person).
@mrjohnston so what you can modify to test is the file downmodis.py:
- after line 648 add
print("inside requests")
- after line 654 add
print("inside urllib")
- after line 655 add `import sys; print(sys.exc_info())
With this lines we can see which library is used to download the data and later check what is the real error.
Please let me know
@lucadelu Thanks, and apologies for the delayed response - happy new year! I edited downmodis.py as suggested, with relevant section (from line 644) reproduced here:
try: # download and write the file
req = urllib.request.Request(url, headers = self.http_header)
http = urllib.request.urlopen(req)
orig_size = http.headers['Content-Length']
filSave.write(http.read())
print("inside requests")
# if local file has an error, try to download the file again
except:
try:
http = requests.get(url, timeout=self.timeout, verify=False)
orig_size = http.headers['Content-Length']
filSave.write(http.content)
print("inside urllib")
except:
import sys; print(sys.exc_info())
logging.error("Cannot download {name}. "
"Retrying...".format(name=filDown))
filSave.close()
os.remove(filSave.name)
import time
time.sleep(5)
self._downloadFileHTTP(filDown, filHdf, day)
filSave.close()
I then attempted to run the new file in python this way:
variables={'destinationFolder':'/tmp','tiles':'h08v07,h09v07,h07v06,h08v06,h09v06,h07v05,h08v05,h09v05','today':"2016-11-01",'delta':1460,'user':'user','password':'password'} execfile("downmodis_edit.py",variables)
There were no errors, but there was also no output (either in the python terminal or in /tmp). I assume something is wrong with my python here, rather than your code? In any event, I'm happy to troubleshoot with you if you think it may be useful in general, but I've also now written my own MODIS download code -- let me know, and thanks again!
@mrjohnston Thanks a lot for your tests. There is something wrong in your edits
try: # download and write the file
req = urllib.request.Request(url, headers = self.http_header)
http = urllib.request.urlopen(req)
orig_size = http.headers['Content-Length']
filSave.write(http.read())
print("inside requests")
# if local file has an error, try to download the file again
except:
try:
http = requests.get(url, timeout=self.timeout, verify=False)
orig_size = http.headers['Content-Length']
filSave.write(http.content)
print("inside urllib")
except:
import sys; print(sys.exc_info())
logging.error("Cannot download {name}. "
"Retrying...".format(name=filDown))
filSave.close()
os.remove(filSave.name)
import time
time.sleep(5)
self._downloadFileHTTP(filDown, filHdf, day)
filSave.close()
When you have modified this, if you are modifying the source code you should also reinstall pyModis, could you try again to download and send me the log file?
Thanks
@lucadelu I just uninstalled pyModis, reinstalled it, and edited downmodis.py to be as above (I don't know what was going on with the indents in my last version; they showed up differently in my text editor, sorry). Then, I imported the (edited) pymodis:
$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4] on linux2
from pymodis import downmodis dest='/tmp' tiles = 'h08v07,h09v07,h07v06,h08v06,h09v06,h07v05,h08v05,h09v05' delta = 1460 day = "2016-11-01" username='user' password='pw' modisDown = downmodis.downModis(destinationFolder=dest, tiles=tiles, today=day, delta=delta, user = username, password = password) modisDown.connect() modisDown.downloadsAllDay()
I'm attaching the resulting logfile. Many thanks!
@mrjohnston sorry I put the print functions but it should be better to use the logging system.
try: # download and write the file
logging.error("inside requests")
req = urllib.request.Request(url, headers = self.http_header)
http = urllib.request.urlopen(req)
orig_size = http.headers['Content-Length']
filSave.write(http.read())
# if local file has an error, try to download the file again
except:
try:
logging.error("inside urllib")
http = requests.get(url, timeout=self.timeout, verify=False)
orig_size = http.headers['Content-Length']
filSave.write(http.content)
except:
import sys; logging.error((sys.exc_info())
logging.error("Cannot download {name}. "
"Retrying...".format(name=filDown))
filSave.close()
os.remove(filSave.name)
import time
time.sleep(5)
self._downloadFileHTTP(filDown, filHdf, day)
filSave.close()
However the problem seems to be related to authorization, instead it return a 401 code error
@lucadelu I edited downmodis.py accordingly, except that the adding "logging.error((sys.exc_info())" caused an error in the import, so I had to omit it (downmodis.py attached).
The new code doesn't create a persistent logfile. The logfile is initialized (0 bytes) and then flashes in and out of the /tmp folder, never growing to >0 bytes. At a keyboard interrupt of the downloadsAllDay process, it disappears.
Regarding the original 401 error, I can reproduce it using the incorrect username/password. However, I'm pretty sure that the username & password I actually use in the code are correct, since they work for manual MODIS downloads.
Apologies for the mystery and the trouble!
Hi, I am having the same problem on Windows 64bit (Server 2012), pyModis 2.0.4. I am getting warnings
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
``` and
``` req = urllib.request.Request(url, headers = self.http_header)
http = urllib.request.urlopen(req)
is throwing an exception "URLError(u'unknown url type: https',)" and then
http = requests.get(url, timeout=self.timeout, verify=False)
orig_size = http.headers['Content-Length']
also throws an exception - because 'Content-Length' doesn't exist since the get request returns 401 - Access denied.
I tried adding 'auth=requests.auth.HTTPBasicAuth(self.user, self.password)
,' in the get request, but it still doesn't work. I can download fine from a browser with the same credentials.
@spatialexplore I also get InsecureRequestWarning but this is not causing me any problem downloading data.
Are you using python 2 or 3?
Are you sure that you download data from the same application that pyModis is using? For example are you able to download this file?
The InsecureRequestWarning should be fixed in 5b77f40, as reported in #81
@lucadelu I am having difficult time while downloading Aqua LST product (MYD11A2.006), the error is displayed as: Exception: There are some troubles with the server. The directory seems to be empty while using this code:
dest = 'D/MODIS_LST/8-dayLST_aqua' tiles = 'h09v05' date = '2011.12.30' enddate = '2011.01.01' product = 'MYD11A2.006'
modis_down = downmodis.downModis(destinationFolder=dest, tiles=tiles, today=date, enddate=enddate, product=product, user=user, password=password) modis_down.connect() modis_down.downloadsAllDay()
the same code works fine for Terra LST. Thanks.
@kbkhand you need to set also path
option to MOLA
.
Try and let me know
@lucadelu it worked! thanks much.
Hi, I got the same problem. My code is: `from pymodis import downmodis dest = "C:/Users/B2046470858/Documents/Isaque/CEF/cmscode/temp/" tiles ="h11v12" day="2016-01-01" productSelect="MOD13Q1.006" delta=45
modisDown = downmodis.downModis(destinationFolder=dest, product=productSelect, tiles=tiles, today=day, delta=delta, user="user", password="passw", debug=True,)
modisDown.connect() modisDown.downloadsAllDay()`
Any guest about?
I'm running the Anaconda python 2.7 in 64bits Windows, and the log file show the problem:
2017-08-16 14:59:42,950 - DEBUG - Starting new HTTPS connection (1): e4ftl01.cr.usgs.gov 2017-08-16 14:59:43,655 - DEBUG - https://e4ftl01.cr.usgs.gov:443 "GET /MOLT/MOD13Q1.006/2016.01.01/MOD13Q1.A2016001.h11v12.006.2016029064227.hdf HTTP/1.1" 302 522 2017-08-16 14:59:43,657 - DEBUG - Starting new HTTPS connection (1): urs.earthdata.nasa.gov 2017-08-16 14:59:44,336 - DEBUG - https://urs.earthdata.nasa.gov:443 "GET /oauth/authorize?scope=uid&app_type=401&client_id=ijpRZvb9qeKCK5ctsn75Tg&response_type=code&redirect_uri=https%3A%2F%2Fe4ftl01.cr.usgs.gov%2Foauth&state=aHR0cHM6Ly9lNGZ0bDAxLmNyLnVzZ3MuZ292L01PTFQvTU9EMTNRMS4wMDYvMjAxNi4wMS4wMS9NT0QxM1ExLkEyMDE2MDAxLmgxMXYxMi4wMDYuMjAxNjAyOTA2NDIyNy5oZGY HTTP/1.1" 401 None 2017-08-16 14:59:44,341 - WARNING - Tried to downlaod with requests but got this error (<type 'exceptions.KeyError'>, KeyError('content-length',), <traceback object at 0x000000000C6CFB88>) 2017-08-16 14:59:44,341 - ERROR - Cannot download MOD13Q1.A2016001.h11v12.006.2016029064227.hdf. Retrying... 2017-08-16 14:59:52,411 - WARNING - Tried to downlaod with urllib but got this error (<class 'future.backports.urllib.error.HTTPError'>, HTTPError(), <traceback object at 0x000000000C6DDF88>)
My installed libraries:
`C:\Users\B2046470858\Documents\Isaque\CEF\cmscode>conda list
packages in environment at C:\Users\B2046470858\AppData\Local\Continuum\Anaconda2:
_license 1.1 py27_1
affine 2.1.0 py27_0 conda-forge
alabaster 0.7.10 py27_0
anaconda custom py27_0
anaconda-client 1.6.3 py27_0
anaconda-navigator 1.6.2 py27_0
anaconda-project 0.6.0 py27_0
asn1crypto 0.22.0 py27_0
astroid 1.4.9 py27_0
astropy 1.3.2 np112py27_0
babel 2.4.0 py27_0
backports 1.0 py27_0
backports_abc 0.5 py27_0
beautifulsoup4 4.6.0 py27_0
biggus 0.15.0 py27_0 conda-forge
bitarray 0.8.1 py27_1
blaze 0.10.1 py27_0
bleach 1.5.0 py27_0
bokeh 0.12.5 py27_1
boto 2.46.1 py27_0
boto3 1.4.4 py27_0 conda-forge
botocore 1.5.84 py27_0 conda-forge
bottleneck 1.2.1 np112py27_0
bzip2 1.0.6 vc9_3 [vc9]
cartopy 0.15.1 np112py27_2 conda-forge
cdecimal 2.3 py27_2
certifi 2017.7.27.1
Hi, I',m having the same problem as above: Not sure what info you need.. I'm going after MOD17A3 data. Not too savvy in python either..
Traceback (most recent call last):
File "/usr/local/bin/modis_download_from_list.py", line 133, in
@penguinnick could you send the command line used?
modis_download.py --url https://e4ftl01.cr.usgs.gov -p MOD17A3.055 -I -r -t h10v05,h11v05,h10v06,h11v06 -A -U <username> -P <password> ~/LVM_share/modis_grid/modis121117/
Hi Luca I have the same issue with Windows 7. I am using pyModis-master and the OSGeo4W64 way of installing. Installation went well, but on trying to download I get this error:
Traceback (most recent call last): File "C:\Users\paree2\AppData\Roaming\GRASS7\addons/scripts/r.modis.download.py", line 269, in
sys.exit(main()) File "C:\Users\paree2\AppData\Roaming\GRASS7\addons/scripts/r.modis.download.py", line 249, in main modisOgg.connect() File "C:\OSGEO4~1\apps\Python27\lib\site-packages\pymodis\downmodis.py", line 383, in connect raise Exception("There are some troubles with the server. " Exception: There are some troubles with the server. The directory seems to be empty
I am using r.modis addon with GRASS GIS.
r.modis.download -g settings=- tiles=h22v05 startday=2016-07-02 endday=2016-07-04 folder=D:\temp
The same command works well in Linux (Ubuntu) with the same latest version of pyModis.
@penguinnick your command is working for me
-rw-r--r-- 1 lucadelu femgis 327 Dec 12 16:28 modisMOD17A3.055.log
-rw-r--r-- 1 lucadelu femgis 1.2M Dec 12 16:28 MOD17A3.A2014001.h10v06.055.2016008120516.hdf
-rw-r--r-- 1 lucadelu femgis 5.8K Dec 12 16:28 MOD17A3.A2014001.h10v05.055.2016008120515.hdf.xml
-rw-r--r-- 1 lucadelu femgis 5.8K Dec 12 16:28 MOD17A3.A2014001.h10v06.055.2016008120516.hdf.xml
-rw-r--r-- 1 lucadelu femgis 5.8K Dec 12 16:28 MOD17A3.A2014001.h11v06.055.2016008120533.hdf.xml
-rw-r--r-- 1 lucadelu femgis 5.8M Dec 12 16:28 MOD17A3.A2014001.h10v05.055.2016008120515.hdf
-rw-r--r-- 1 lucadelu femgis 0 Dec 12 16:28 MOD17A3.A2014001.h11v05.055.2016008120532.hdf
-rw-r--r-- 1 lucadelu femgis 242 Dec 12 16:28 listfileMOD17A3.055.txt
@penguinnick @spareeth did you follow the instructions and are you sure about user and password?