The wekeo provider in EODAG

Hint

You can run this notebook in a live session with Binder.

The wekeo provider in EODAG#

This tutorial will show you how use EODAG to download data from WEkEO using eodag. WEkEO offers a wide range of Copernicus and Sentinel products.

Registration#

For both, searching and downloading data, authentication is required. Therefore, you first have to create an account on https://www.wekeo.eu/ to get a username and a password which have to be added to the EODAG configuration (see Configure EODAG). After registration you also have to accept the Terms and Conditions for the datasets you want to use to be able to retrieve data from EODAG. This has to be done once per user and licence by executing the following code where licence_name has to be set to the desired licence (see list below):

[1]:
import requests
from eodag import EODataAccessGateway

# instantiate EODAG API
dag = EODataAccessGateway()

# Authenticate on wekeo
auth = dag._plugins_manager.get_auth_plugin("wekeo").authenticate()
licence_name = "EUMETSAT_Copernicus_Data_Licence"

# Use your authentication to accept Terms and Conditions
response = requests.put(
    f"https://gateway.prod.wekeo2.eu/hda-broker/api/v1/termsaccepted/{licence_name}",
    auth=auth,
)

Depending on which data you want to use, different licences have to be accepted. If you want to use all the product types available in EODAG for the provider wekeo, the following licences have to be accepted:

  • EUMETSAT_Copernicus_Data_Licence

  • Copernicus_Land_Monitoring_Service_Data_Policy

  • Copernicus_Sentinel_License

  • Copernicus_ECMWF_License

  • Copernicus_DEM_Instance_COP-DEM-GLO-30-F_Global_30m

  • Copernicus_DEM_Instance_COP-DEM-GLO-90-F_Global_90m

To access the products of the provider wekeo_cmems the licence Copernicus_Marine_Service_Product_License has to be accepted.

Search and download data#

Many product types are available for wekeo provider:

[2]:
wekeo_product_types = dag.list_product_types("wekeo")
len(wekeo_product_types)
[2]:
81
[3]:
[pt["ID"] for pt in wekeo_product_types]
[3]:
['CAMS_EAC4',
 'CAMS_EAC4_MONTHLY',
 'CAMS_EU_AIR_QUALITY_FORECAST',
 'CAMS_EU_AIR_QUALITY_RE',
 'CAMS_GAC_FORECAST',
 'CAMS_GLOBAL_EMISSIONS',
 'CAMS_GREENHOUSE_EGG4',
 'CAMS_GREENHOUSE_EGG4_MONTHLY',
 'CAMS_GREENHOUSE_INVERSION',
 'CAMS_GRF',
 'CAMS_GRF_AUX',
 'CAMS_SOLAR_RADIATION',
 'CLMS_CORINE',
 'CLMS_GLO_DMP_333M',
 'CLMS_GLO_FAPAR_333M',
 'CLMS_GLO_FCOVER_333M',
 'CLMS_GLO_GDMP_333M',
 'CLMS_GLO_LAI_333M',
 'CLMS_GLO_NDVI_1KM_LTS',
 'CLMS_GLO_NDVI_333M',
 'COP_DEM_GLO30_DGED',
 'COP_DEM_GLO30_DTED',
 'COP_DEM_GLO90_DGED',
 'COP_DEM_GLO90_DTED',
 'EEA_DAILY_VI',
 'EFAS_FORECAST',
 'EFAS_HISTORICAL',
 'EFAS_REFORECAST',
 'EFAS_SEASONAL',
 'EFAS_SEASONAL_REFORECAST',
 'ERA5_LAND',
 'ERA5_LAND_MONTHLY',
 'ERA5_PL',
 'ERA5_PL_MONTHLY',
 'ERA5_SL',
 'ERA5_SL_MONTHLY',
 'FIRE_HISTORICAL',
 'GLACIERS_DIST_RANDOLPH',
 'GLOFAS_FORECAST',
 'GLOFAS_HISTORICAL',
 'GLOFAS_REFORECAST',
 'GLOFAS_SEASONAL',
 'GLOFAS_SEASONAL_REFORECAST',
 'GRIDDED_GLACIERS_MASS_CHANGE',
 'S1_SAR_GRD',
 'S1_SAR_OCN',
 'S1_SAR_RAW',
 'S1_SAR_SLC',
 'S2_MSI_L1C',
 'S2_MSI_L2A',
 'S2_MSI_L2AP',
 'S3_EFR',
 'S3_ERR',
 'S3_LAN_HY',
 'S3_LAN_LI',
 'S3_LAN_SI',
 'S3_OLCI_L2LFR',
 'S3_OLCI_L2LRR',
 'S3_OLCI_L2WFR',
 'S3_OLCI_L2WRR',
 'S3_SLSTR_L1RBT',
 'S3_SLSTR_L2',
 'S3_SRA',
 'S3_SRA_A',
 'S3_SRA_BS',
 'S3_WAT',
 'S5P_L1B_IR_ALL',
 'S5P_L2_IR_ALL',
 'SATELLITE_CARBON_DIOXIDE',
 'SATELLITE_METHANE',
 'SATELLITE_SEA_ICE_EDGE_TYPE',
 'SATELLITE_SEA_LEVEL_BLACK_SEA',
 'SATELLITE_SEA_LEVEL_GLOBAL',
 'SATELLITE_SEA_LEVEL_MEDITERRANEAN',
 'SEASONAL_MONTHLY_PL',
 'SEASONAL_MONTHLY_SL',
 'SEASONAL_ORIGINAL_PL',
 'SEASONAL_ORIGINAL_SL',
 'SEASONAL_POSTPROCESSED_PL',
 'SEASONAL_POSTPROCESSED_SL',
 'UERRA_EUROPE_SL']

Search for data on one these product types:

[4]:
products, total_count = dag.search(
    productType="GLOFAS_FORECAST",
    start="2023-01-01",
    end="2023-01-02",
    geom=[0.25, 43.2, 2.8, 43.9],
    provider="wekeo"
)
products
[4]:
SearchResult([EOProduct(id=4bd37b17b45d146f378e349ab3f90464, provider=wekeo)])

Download found product to /tmp, changing wait time to 12s (0.2’) between product order and download retries:

[5]:
path = products[0].download(outputs_prefix="/tmp", wait=0.2)
path
[Retry #1] Waiting 11.999954s until next download try for ordered product (retry every 0.2' for 20')
[5]:
'/tmp/4bd37b17b45d146f378e349ab3f90464'

The WEkEO data viewer#

If you go to the WEkEO homepage and click on “Data” in the top menu, you can search for products online. You can choose a product type (called dataset in WEkEO) by clicking on the “+” button next to “Layers” on the left side. Then you can choose some filter parameters and create a data request job which will show up in the next tab where the products can be downloaded. The data viewer currently still uses the old version of the API where data requests have to be created to search product. In contrast, the latest version of EODAG already uses the new API (https://gateway.prod.wekeo2.eu/hda-broker/api/v1) where a direct search without data requests is possible.