Commit 835a8bf46065839ae678a016da3267310e41f139

Authored by Olivier Hagolle
2 parents 5ff1c545 3445bd2b
Exists in master

Merge branch 'master' of https://github.com/olivierhagolle/LANDSAT-Download

Showing 2 changed files with 8 additions and 9 deletions   Show diff stats
README.md
... ... @@ -4,28 +4,28 @@ LANDSAT-Download
4 4 The routine provided below enables to automatically download LANDSAT data, using the current (April 2014) version of EarthExplorer system.
5 5  
6 6  
7   -It works for LANDSAT 8 and LANDSAT 5&7, but needs that the data be already online. It seems to be systematically the case for LANDSAT 8, but for the older LANDSAT, it may be necessary to first order for the production of L1T products, on the earthexplorer site http://earthexplorer.usgs.gov. And of course, you will need to have an accont and password on the Earthexplorer website, to store on the usgs.txt file. If you have an access through a proxy, you might try the -p option. it works through CNES proxy at least but was only tested there.
  7 +It works for LANDSAT 8 and LANDSAT 5&7, but needs that the data be already online. It seems to be systematically the case for LANDSAT 8, but for the older LANDSAT, it may be necessary to first order for the production of L1T products, on the earthexplorer site http://earthexplorer.usgs.gov. And of course, you will need to have an account and password on the Earthexplorer website, to store on the usgs.txt file. If you have an access through a proxy, you might try the -p option. it works through CNES proxy at least but was only tested there.
8 8  
9 9 This routine may be used in two ways :
10 10  
11 11 - by providing the WRS-2 coordinates of the LANDSAT scene, for instance, (198,030) for Toulouse. And, as LANDSAT passes every 16 days, you also have to provide with the -d option, the exact value of a LANDSAT overpass. Example:
12 12  
13   -` python download_landsat_scene.py -o scene -t LC8 -a 2013 -d 113 -f 365 -s 199030 -u usgs.txt`
  13 +` download_landsat_scene.py -o scene -a 2013 -d 106 -f 365 -s 181025 -u usgs.txt -p proxy.txt --output /mnt/data/LANDSAT8/N0/`
14 14  
15 15 - by providing a list of products to download, as in the example below:
16 16  
17   -` python download_landsat_scene.py -o liste -l list2_landsat8.txt -u usgs.txt`
  17 +` python download_landsat_scene.py -o liste -l list2_landsat8.txt -u usgs.txt --output /mnt/data/LANDSAT8/N0/`
18 18  
19 19 with a file list2_landsat8.txt as provide below (the landsat references must exist in the earthexplorer catalog) :
20 20  
21   - ` Tunisie LC81910352013160LGN00`
  21 +` Tunisie LC81910352013160LGN00`
22 22  
23   - ` Tunisie LC81910362013160LGN00`
  23 +` Tunisie LC81910362013160LGN00`
24 24  
25 25 The usgs.txt must contain your username and password on the same line separated by a blank.
26 26  
27   -The files will be downloaded to /tmp/Landsat, unless you change the default folder with --output option
  27 +If you do not use the --ouput option, the files will be downloaded to /tmp/Landsat (provided it exists)
28 28  
29 29 To see all the options :
30   - ` download_landsat_scene.py -h`
  30 +` download_landsat_scene.py -h`
31 31  
... ...
download_landsat_scene.py
... ... @@ -30,7 +30,7 @@ def connect_earthexplorer_proxy(proxy_info,usgs):
30 30  
31 31 # installation
32 32 urllib2.install_opener(opener)
33   -
  33 +
34 34 # parametres de connection
35 35 params = urllib.urlencode(dict(username=usgs['account'], password=usgs['passwd']))
36 36  
... ... @@ -216,7 +216,6 @@ if not os.path.exists(rep):
216 216 try:
217 217 f=file(options.usgs)
218 218 (account,passwd)=f.readline().split(' ')
219   - print account,passwd
220 219 if passwd.endswith('\n'):
221 220 passwd=passwd[:-1]
222 221 usgs={'account':account,'passwd':passwd}
... ...