eodal.downloader.sentinel2.copernicus module

This module is a very basic approach to query the Sentinel Copernicus archive using the Sentinelsat package as API client. Before executing, make sure to have DHUS_USER and DHUS_PASSWORD stored as environmental variables (and to have access to the API hub). See also the Sentinelsat docs for more information: https://sentinelsat.readthedocs.io/en/stable/index.html

On a Linux system you can specify your credentials in the current Python environment by:

export DHUS_USER = "<your-user-name>"
export DHUS_PASSWORD= "<your-password>"

Copyright (C) 2022 Lukas Valentin Graf

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class eodal.downloader.sentinel2.copernicus.Platforms(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Sentinel1 = 'Sentinel-1'
Sentinel2 = 'Sentinel-2'
Sentinel3 = 'Sentinel-3'
eodal.downloader.sentinel2.copernicus.download_data(df: DataFrame, download_dir: Path) None[source]

downloads Sentinel products from Copernicus DHUS using the download API client implemented in Sentinelsat.

Parameters:
  • df – dataframe containing products URIs and links returned from calling Sentinelsat’s API client

  • download_dir – directory where to download the data to

eodal.downloader.sentinel2.copernicus.query_from_copernicus(footprint_file: Path, date_start: date, date_end: date, platform: Platforms, cloud_cover_threshold: float | None = 80.0, **kwargs) DataFrame[source]

This method can be used to query Sentinel (1,2,3) data from Copernicus Scientific Data Hub (DHUS) using the user provided credentials for calling the product search API.

NOTE: Since Copernicus changed its archive policy to a rolling-archive, older data might not be maintained in the SciHub archive (i.e., it is not “online”) and has to be requested from the long-term archive (LTA). Alternatively, downloading from a national data access point or DIAS is recommended if the data requested is in the LTA.

Parameters:
  • footprint_file – filepath to any vector file containing the geometry for which to search and optionally download Sentinel data

  • date_start – start date of the search period

  • date_end – end date of the search period

  • platform – name of the Sentinel platform (1,2,3) to download

  • cloud_cover_threshold – cloud cover percentage threshold (0-100 percent). Scenes with a cloud cover percentage higher than the threshold are discarded. The default is 80 percent.

  • download_data – boolean flag indicating if found dataset shall be donwloaded or not. The default is True (i.e, download data).

  • kwargs – additional keyword arguments to use to filter the dataframe containing the found products. It only works for filtering that equals one property to an threshold or given value. For more advanced filtering apply the custom filtering logic in the calling script.

Return products:

data frame with the found datasets (products).