olivierhagolle / theia_download

To download products provided by Theia land data center : https://theia.cnes.fr
45 stars 23 forks source link
atmospheric-correction cloud-detection data-downloader landsat remote-sensing sentinel-2 snow-cover spot theia

theia_download

This is a simple piece of code to automatically download the products provided by Theia land data center : https://theia.cnes.fr. It can download the products delivered by Theia, such as the [Sentinel-2 L2A products] (http://www.cesbio.ups-tlse.fr/multitemp/?page_id=6041), Landsat L2A products and the SpotWorldHeritage L1C products.

This code was written thanks to the precious help of one my colleague at CNES Jérôme Gasperi 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 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, 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

Other options

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

which downloads the SENTINEL2 T31TCJ tile, with the relative Orbit Number 51, acquired in 2017.

Authentification

The config file config_landsat.cfg or config_landsat.cfg must contain your email address and your password as in the examples provided.

If you need to go through a proxy, and if you have not configured your proxy variable (export http_proxy=http://moi:secret@proxy.mycompany.fr: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.

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