Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Platform "MULTISAT" to download only L3B-SNOW products #22

Open
wants to merge 33 commits into
base: python3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
92b72b9
[DOC] add info about Python3 branch
olivierhagolle Apr 29, 2018
17156d0
[DOC] Typo for news abbout Python3
olivierhagolle Apr 29, 2018
35b89e7
catch error when no product corresponds to selection criteria
olivierhagolle Jun 15, 2018
88c8df2
Merge branch 'master' of https://github.com/olivierhagolle/theia_down…
olivierhagolle Jun 15, 2018
e0b89ce
Add access to Sentinel-2 Level3A products
olivierhagolle Aug 20, 2018
523ecb0
[ENH] warn about password with special characters
olivierhagolle Oct 7, 2018
c088cd9
[ENH] select product level for VENUS
olivierhagolle Nov 23, 2018
4aee284
remove old authentification file
olivierhagolle Jan 31, 2019
28f6b75
[ENH] Add Landsat 8
olivierhagolle Apr 19, 2019
eb933e5
[ENH] Add access to LANDSAT collection
olivierhagolle Apr 22, 2019
278d123
[DOC] Add Example for Landsat collection
olivierhagolle Apr 22, 2019
80c47be
remove config files for old theia_landsat web site
olivierhagolle Apr 22, 2019
5407954
add a module to check dates
olivierhagolle Nov 14, 2019
ad2c74c
add query with site (-s), for VENµS
olivierhagolle Feb 12, 2020
6a6e197
[BUG] when tile number provided without initial T
olivierhagolle Feb 12, 2020
51db99d
[BUG] add example with -t option [tile]
olivierhagolle Feb 12, 2020
18ddc7f
[ENH] should work both with python2 and 3
olivierhagolle Feb 12, 2020
0364276
[ENH] catch error with config filename
olivierhagolle Feb 12, 2020
dad2639
[DOC]works with python 2.7 and python 3
olivierhagolle Feb 12, 2020
279dc4d
[DOC] document -s option (for site), active for VENµS
olivierhagolle Feb 12, 2020
80f7ff8
add 'old format' collections
olivierhagolle Feb 13, 2020
ce8f3a1
[DOC] possibility to download "old format" collections
olivierhagolle Feb 13, 2020
8809699
Issue correction : modification of SpotWorldHeritage collection name,…
Jul 29, 2020
95538d5
[DOC] Advertise EODAG
olivierhagolle Feb 4, 2021
db5da8e
[DOC] typo
olivierhagolle Feb 4, 2021
6d697da
add option --snow_level to download L3B-SNOW
Apr 3, 2021
2b79c50
Change registration URL
olivierhagolle Aug 2, 2022
40b3169
Adding VENUS VM05
jerome-colin Mar 24, 2023
fafe4f6
Adding example for VENUS VM05 to Readme
jerome-colin Mar 24, 2023
d957854
Merge pull request #34 from olivierhagolle/add_VM5
jerome-colin Mar 24, 2023
793662f
Merge pull request #23 from sgascoin/master
jerome-colin Mar 24, 2023
66594d0
Some PEP8 refactoring
jerome-colin Mar 24, 2023
5531ef3
Fix default behavior of option -a
jerome-colin Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 38 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a simple piece of code to automatically download the products provided b

This code was written thanks to the precious help of one my colleague at CNES [Jérôme Gasperi](https://www.linkedin.com/pulse/rocket-earth-your-pocket-gasperi-jerome) who developped the "rocket" interface which is used by Theia, and the mechanism to get a token. It was then adapted by Dominique Clesse for the new Muscate interface to download Sentinel-2 products.

This code relies on python 2.7 and on the curl utility. *Installing curl is therefore a prerequisite*. It has been developped and tested on Linux. It might work on windows, but I cannot test it. To use the code, you need to have an account and a password [at theia](http://theia.cnes.fr/atdistrib), and you need to add it to the config file as explaned in the authentification paragraph.
This code has been tested with python 2.7 and python 3.6. It relies on the curl utility. *Installing curl is therefore a prerequisite*. It has been developped and tested on Linux. It might work on windows, but I cannot test it. To use the code, you need to have an account and a password [at theia](https://sso.theia-land.fr/theia/register/register.xhtml), and you need to add it to the config file as explained in the authentification paragraph.

## Examples for various sensors
If you have an account at theia, you may download products using command lines like
Expand All @@ -15,21 +15,42 @@ If you have an account at theia, you may download products using command lines l

- `python ./theia_download.py -l 'Toulouse' -c SENTINEL2 -a config_theia.cfg -d 2016-09-01 -f 2016-10-01 -m 50`

which downloads the SENTINEL-2 products above Toulouse, acquired in September 2016 with less tha 50% cloud cover
which downloads the SENTINEL-2 products above Toulouse, acquired in September 2016 with less than 50% cloud cover

- `python ./theia_download.py -l 'Toulouse' -c Landsat -a config_landsat.cfg -d 2016-09-01 -f 2016-10-01`
- `python ./theia_download.py -l 'Toulouse' -c LANDSAT -a config_theia.cfg -d 2019-01-01 -f 2019-02-01`

which downloads the LANDSAT-8 products above Toulouse, acquired in September 2016.
which downloads the LANDSAT-8 products above Toulouse, acquired in January 2019.

- `python ./theia_download.py -l 'Toulouse' -c Landsat -a config_theia.cfg -d 2016-09-01 -f 2016-10-01`

which downloads the LANDSAT-8 products, with the old MUSCATE format above Toulouse, acquired in September 2016.

- `python ./theia_download.py -l 'France' -c VENUS -a config_theia.cfg -d 2019-01-01 -f 2019-02-01`

which downloads the VENUS products from all sites in France, acquired in January 2019.

- `python ./theia_download.py -s 'KHUMBU' -c VENUS -a config_theia.cfg -d 2019-01-01 -f 2019-02-01`

which downloads the VENUS products above KHUMBU site, acquired in January 2019.

- `python ./theia_download.py -s 'HECHUAN' -c VENUSVM05 -a config_theia.cfg -d 2023-03-17 -f 2023-03-18`

- `python ./theia_download.py -l 'Toulouse' -c SpotWorldHeritage -a config_landsat.cfg -d 2006-01-01 -f 2007-01-01`
which downloads the latest VENUS VM05 products above HECHUAN site, acquired in March 2023.

which downloads the SPOT World Heritage products above Toulouse, acquired in 2006.
- `python ./theia_download.py -l 'Yaounde' -c SPOTWORLDHERITAGE -a config_theia.cfg -d 2012-01-01 -f 2013-01-01`


- `python ./theia_download.py -l 'Toulouse' -c SWH1 -a config_theia.cfg -d 2006-01-01 -f 2007-01-01`

which downloads the SPOT World Heritage products old format above Toulouse, acquired in 2006.

- `python ./theia_download.py -l 'Foix' -c Snow -a config_theia.cfg -d 2016-11-01 -f 2016-12-01`

which downloads the Theia snow products above Foix (Pyrenees), acquired in November 2016. The collection option is case sensitive.

As you must have noted, there are two different config files, depending on the whether you are using SENTINEL2 data (config_theia.cfg) , or Landsat or Spot world Heritage data (config_landsat.cfg). This is temporary, due to the start of MUSCATE ground segment, and soon, all the products will accessed with the config_theia.cfg authentification.
- `python ./theia_download.py -t 31TGK -a config_theia.cfg -c Snow -d 2015-01-01 --snow_level L3B-SNOW`

which downloads all available Level-3B Snow products (annual syntheses) of tile 31TGK.

## Other options

Expand All @@ -45,9 +66,9 @@ As you must have noted, there are two different config files, depending on the w

which downloads the LANDSAT 8 products in latitude, longitude box around Toulouse, acquired in November 2015.

- `python theia_download.py -l 'Toulouse' -a config_landsat.cfg -c SpotWorldHeritage -p SPOT4 -d 2005-11-01 -f 2006-12-01`
- `python theia_download.py -l 'Toulouse' -a config_landsat.cfg -c SPOTWORLDHERITAGE -p SPOT4 -d 2005-11-01 -f 2006-12-01`

which downloads the SpotWorldHeritage products acquired by SPOT5 in 2005-2006
which downloads the SPOTWORLDHERITAGE products acquired by SPOT5 in 2005-2006

- `python ./theia_download.py -c SENTINEL2 -t T31TCJ -r 51 d 2017-01-01 -f 2018-01-01`

Expand All @@ -60,5 +81,12 @@ The config file config_landsat.cfg or config_landsat.cfg must contain your em

If you need to go through a proxy, and if you have not configured your proxy variable (`export http_proxy=http://moi:[email protected]:8050`), you may also use one of the files like config_theia_proxy.cfg or config_landsat_proxy.cfg and add your passwords in them.

The program first fetches a token using your email address and password, and then uses it to download the products. As the token is only valid for two hours, it is advised to request only a reasonable number of products. It is necessary to make a first download from the site manually in order to validate your accound and the licence in the case of SpotWorldHeritage.
The program first fetches a token using your email address and password, and then uses it to download the products. As the token is only valid for two hours, it is advised to request only a reasonable number of products. It is necessary to make a first download from the site manually in order to validate your accound and the licence in the case of SPOTWORLDHERITAGE.

## Alternatives

The EODAG tool has an interface to download data from Theia, PEPS, and many others, and it is probably much more professional code. You might give it a try.

https://eodag.readthedocs.io/en/latest/#

https://github.com/CS-SI/eodag
1 change: 0 additions & 1 deletion auth_theia.txt

This file was deleted.

8 changes: 0 additions & 8 deletions config_landsat_proxy.cfg

This file was deleted.

8 changes: 0 additions & 8 deletions config_theia_proxy.cfg

This file was deleted.

Loading