Terradue is populating the CNR-ISSIA FTP server with Sentinel-2 data over a growing number of Protected Areas.
Discovering the Sentinel-2 products
A simple way to discover Sentinel-2 products is to use the OpenSearch client to query the catalogue.
Let’s say we want to discover the Sentinel-2 products over the Doñana Protected area which has a bounding box expressed with the lower left and top right corners by:
-6.93,36.65,-6.02,37.47
and a Time of Interest of January 2016, the query is constructed with:
opensearch-client \ -p bbox="-6.93,36.65,-6.02,37.47" \ -p start="2016-01-01" \ -p stop="2016-01-31" \ https://data2.terradue.com/eop/ecop-cnr-issia/series/sentinel-2/search \ enclosure
The last line of the command above instructs the client to return the URLs of the Sentinel-2 products.
The output is:
ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/28/S2A_OPER_PRD_MSIL1C_PDMC_20160128T213131_R137_V20160128T112006_20160128T112006.zip ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/25/S2A_OPER_PRD_MSIL1C_PDMC_20160128T032144_R094_V20160125T111611_20160125T111611.zip ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/21/S2A_OPER_PRD_MSIL1C_PDMC_20160121T234546_R037_V20160121T113930_20160121T113930.zip ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/18/S2A_OPER_PRD_MSIL1C_PDMC_20160119T094258_R137_V20160118T113008_20160118T113008.zip ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/11/S2A_OPER_PRD_MSIL1C_PDMC_20160120T135650_R037_V20160111T113319_20160111T113319.zip ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/08/S2A_OPER_PRD_MSIL1C_PDMC_20160108T173906_R137_V20160108T112432_20160108T112432.zip ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/05/S2A_OPER_PRD_MSIL1C_PDMC_20160105T184105_R094_V20160105T111934_20160105T111934.zip ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/01/S2A_OPER_PRD_MSIL1C_PDMC_20160101T193352_R037_V20160101T113117_20160101T113117.zip
Now we have all the Sentinel-2 product URLs over the Doñana protected area of January 2016.
Downloading the discovered Sentinel-2 products
Make sure you have an account on the CNR FTP server, you will need that information to download the data.
We will use an FTP client lftp
that must be installed on the sandbox with:
sudo yum install -y lftp
We now need to manipulate the Sentinel-2 URLs returned by the opensearch-client
to correctly pass these to lftp
First the FTP hostname:
ftp_hostname="$( echo "ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/28/S2A_OPER_PRD_MSIL1C_PDMC_20160128T213131_R137_V20160128T112006_20160128T112006.zip" | cut -d "/" -f 3- )"
The value is res.ba.issia.cnr.it
Then, the product path:
product_path="$( echo "ftp://res.ba.issia.cnr.it//incoming/terradue/sentinel2/2016/01/28/S2A_OPER_PRD_MSIL1C_PDMC_20160128T213131_R137_V20160128T112006_20160128T112006.zip" | cut -d "/" -f 4- )
The value is: /incoming/terradue/sentinel2/2016/01/28/S2A_OPER_PRD_MSIL1C_PDMC_20160128T213131_R137_V20160128T112006_20160128T112006.zip
Now let’s build the request:
lftp -u <username,password> -e "get ${product_path}" ${ftp_hostname}
Wait for the download to complete and process the data!
ECOPOTENTIAL is a large European-funded H2020 project that focuses its activities on a targeted set of internationally recognised Protected Areas, blending Earth Observations from remote sensing and field measurements, data analysis and modelling of current and future ecosystem conditions and services. ECOPOTENTIAL considers cross-scale geosphere-biosphere interactions at regional to continental scales, addressing long-term and large-scale environmental and ecological challenges.