1

I tried to access the FTP site of MODIS data using Python ftplib module but always fail to connect. I am connecting using: ftp = ftplib.FTP("e4ftl01.cr.usgs.gov")

here is the error: A connection attempt failed because the connected party did not properly respond after a period of time, or establishment connection failed because connected host has failed to respond.

However, if I access the ftp site thru my web browser, I was able to connect and download files.

2

That is because you are accessing the HTTP archive at http://e4ftl01.cr.usgs.gov/. ftplib is expected to fail when you try to connect to HTTP instead of FTP.

The FTP archive is located at ftp://ladsweb.nascom.nasa.gov/allData/.

However, both archives do not contain the exact same data. Depending on the MODIS product you are looking for you might find it on the FTP or you might not. The obvious Python choice for accessing the HTTP archive would be urllib or requests, or you could just use one of the existing Python MODIS modules like pymodis.

2

You may want to check http://www.pymodis.org which is a Free and Open Source Python based library to work with MODIS data.

It offers bulk-download for user selected time ranges, mosaicking of MODIS tiles, and the reprojection from Sinusoidal to other projections, convert HDF format to other formats and the extraction of data quality information.

In the last days a series of updates where applied, also to the related GRASS GIS 7 Addon r.modis which is a toolset to import MODIS satellite data into GRASS GIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.