=> The Python routine, provided via the link at the end of this post, enables batch downloads of LANDSAT data, on USGS earth explorer site. It works for LANDSAT 8 and LANDSAT 7 (and could work for LANDSAT 5), it just requires that the data are available on line. It is the case for all LANDSAT 8 data, but for LANDSAT 5&7, it may be necessary to order the data first on http://earthexplorer.usgs.gov. The routine of course requires that you have an account and password on earth explorer, and you will have to configure your accounts and directories within the routine. This routine may be used in two ways :

  • You select a LANDSAT scene defined by its WRS-2 coordinates (for instance, (198,030) pour Toulouse). The -d option requires that you provide a day of year for which the scene was observed (1 overpass every 16 days)
    • example :
    • python  download_landsat_scene.py -o scene -t LC8 -a 2013 -d 113 -f 365 -s 199030
  • You provide a list of products to download, with a site name for each product.
    • Example :
      python download_landsat_scene.py -o list -l landsat8_list.txt
    • landsat8_list.txt is as follows : of course, you need to get the references on Earth Explorer.
    • Tunisia LC81910352013160LGN00Tunisia LC81910362013160LGN00

 The routine is available here : Download_landsat_scene.py Once you have downloaded the data, you will probably want to convert them to reflectances or temperatures for the thermal bands. One of our colleagues at CESBIO provides a Python module to do the conversion (The post is in French, but Python is a universal language…).

11 thoughts on “A python module for batch downloads of LANDSAT data.

  1. Dear Mr. Hagolleyou are mentioning that (at https://labo.obs-mip.fr/multitemp/?p=3121#respond):… colleagues at CESBIO provides python modulea to do the conversion (The post is in French, but Python is a universal language…).Unfortunately, the final link provided on your colleagues page (-> http://130.120.117.103/Sie/?p=1120) (which should be pointing to the actual routine -> cnToTOA.py)(-> http://www.cesbio.ups-tlse.fr/SIE_blog/?attachment_id=1158) is not freely accessible and therefore the routine cannot be accessed. I would really be interested to test this interesting code. greetingsChristian

    1. Thanks for the comment, I asked my colleague to update this link (which points to an older server adress).\nHe usually reacts quickly.\nOlivier

  2. Hi, your script look good but I don’t know some error. I used your example but this script not download anything but echo « /to/be/changed/…. ». And what is user=’CNESNET\login’, passwd=’secret’,proxy_info = {..}. I don’t have it, how can I have a account proxy?F:\>python download_landsat_scene.py -o scene -a 2014 -d 60 -f 100 -s 198024/to/be/changed//SCENES/198_024/GZ

    1. Dear Bang,\nthis tool is meant for programmers who know some python. The /to/be/changed obviously need to be customized with your own Path to where you want to store data. And the part about CNES proxy is just an example, and if you do not have a proxy, then it is even simpler for you.\nGood Luck,\nOlivier

  3. For some reason, this package did not work since yesterday. I got some error similar to the following:File « C:\Python27\ArcGISx6410.1\lib\urllib2.py », line 521, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 404: Not Found.what is the problem?

  4. here is the command line i used:python download_landsat_scene.py -z unzip -o scene -u U:\gis_jinkai\landsat_auto_download\usgs.txt -b LC8 -d 20150628 -f 20150630 –output U:\gis_jinkai\landsat_down_temp\29-Jun-15 -s 040025

  5. Hi Olivier,I’m having difficulty working with the list option and was wondering if you could help. The first option works fine for me. The error I get is as follows: »URL Error: no host given http://ers.cr.usgs.gov/download/4923/LC81130802016119LGN00/STANDARD/EE« I have tried your worked example with the same result. I am working with a download of the script from the Github site and I know the list of scenes are available on USGS.ThanksBart

    1. Dear Bart,\n I do not use the list option, and I do not test it much. A few months ago, USGS changed the URL to access the data\nIt was http://ers.cr.usgs.gov/ and became http://earthexplorer.usgs.gov/\n\nI corrected it for the scene option but I am afraid not for the list option.\n\nI’ll try to update on my side but I lack time, can you test it directly on your side ?\nOlivier\n

  6. Hi Oliver I am using this script for the past few months. I have noticed two things1) Some times the Julian date is calculated incorrectly. I can see an image on a specific date in EE but the script skips that date.2) There is some issue with option -c (cloud filter) as I tried to download some images with -c 10 but all the images re above 10% cloud cover. Thanks for your help and this script. Muhammad

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.