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.

markusN
13.1k33 silver badges49 bronze badges
asked Oct 29, 2015 at 6:37

2 Answers 2

3

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.

edit:

As mentioned by Devdatta in the comments, disregard the FTP information post 2018 as this source has been retired.

answered Oct 29, 2015 at 7:35
3
  • Hi @Kersten, why I cannot access the ftp server ladsweb.nascom.nasa.gov/allData tried ftp = FTP(host). host = 'ladsweb.nascom.nasa.gov/allData'. The error is gaierror: [Errno 11001] getaddrinfo failed. But I can open the ftp site in my browser. Commented Oct 10, 2016 at 7:45
  • @user32145 stackoverflow.com/a/34282077/4169585 Commented Oct 10, 2016 at 8:08
  • 1
    For those who are looking at this answer post 2018, do note that the FTP server has been retired, and the recommended way is to get the data from https://ladsweb.modaps.eosdis.nasa.gov/ Commented Aug 17, 2018 at 9:36
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.

answered Oct 31, 2015 at 16:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.