How to order CDS ERA5 products on CREODIAS

../_images/button_orange_cf24.png

Most of CREODIAS products can be ordered by EO Finder. CDS ERA5 products have a different way of ordering. This manual will guide you through the necessary steps to have CDS ERA5 products ordered and available in your cloud.

Click here to go to Copernicus website and select a collection (Dataset) that you need. In this example, we use “ERA5-Land hourly data from 1981 to present” collection.

On the collection website, there is a “Data download” tab with “Variable” fields to select. There may be differences in the “Download data” variables and other collection’s specifications. In this example we have: Temperature, Lakes, Snow, Soil Water, Radiation and Heat, Evaporation and Runoff, Wind, Pressure and Precipitation and Vegetation. There are also Year, Month, Day, Time for selected data. Mark them as on screenshots below:

../_images/cds-07.png ../_images/cds-08.png

Choose all variables of your interest. On the bottom of the page press “Show API request”.

../_images/cds-05.png

Another field is shown now with API code, which will be used to create an order script. There is an example of such script below with parts needed to be marked separately.

../_images/cds-06.png

We have all the details necessary to make an order.

You can make an order from your desktop or VM.

You need to use OpenStackClient. See: How to install OpenStackClient for Linux on CREODIAS.

Now invoke the following command (XXXXX is the number of your domain, see: What is an OpenStack domain on CREODIAS) and type your password.

source cloud_XXXXX_project_with_eo-openrc.sh
Please enter your OpenStack Password:

Generate keycloak token with the following command;

export KEYCLOAK_TOKEN=$(curl -d 'client_id=CLOUDFERRO_PUBLIC' -d "username=${OS_USERNAME}" -d "password=${OS_PASSWORD}" -d 'grant_type=password' 'https://auth.creodias.eu/auth/realms/DIAS/protocol/openid-connect/token' | python -m json.tool | grep "access_token" | awk -F\" '{print $4}')

For additional information on keycloak tokens, see How to generate keycloak token on CREODIAS.

We need to prepare a script which will make an order for us. Script has to be run in Python 3 environment. If you don’t have Python 3 please check this manual How to install Python virtualenv or virtualenvwrapper on CREODIAS.

Please check the API code above generated on copernicus.eu. There are marked parts which we use in the following script

import requests
import os
keycloak_token=(os.environ['KEYCLOAK_TOKEN'])


input_data = {
    "order_name": "test_cds",
    "priority": 1,
    "processor": "cds",
    "extra": {
        'data_set': 'reanalysis-era5-land-monthly-means', ##### Part 1 from API code
        'options': {                                                                         ##### Part 2 from API code (start)
        'format': 'grib',
        'variable': [
            '10m_u_component_of_wind', '10m_v_component_of_wind', '2m_dewpoint_temperature',
            'evaporation_from_bare_soil', 'evaporation_from_the_top_of_canopy', 'evapotranspiration',
            'forecast_albedo', 'lake_bottom_temperature', 'lake_ice_temperature',
        ],
        'year': '2019',
        'month': '01',
        'time': [
            '00:00', '01:00', '02:00',
        ],
    },
        'filename': 'test_reanalysis-era5-land-monthly-means.grib' # The name of the product
    }                                                                                            ##### Part 2 from API code (end)
}
headers = {'content-type': 'application/json', 'accept': 'application/json', 'Keycloak-Token': keycloak_token}

session = requests.Session()

query = 'https://finder.creodias.eu/api/order/'
response = session.post(query, json=input_data, headers=headers)
response.close()

Now run the python script. If there are no messages, the order is ready.

You can check it in Creodias Finder

../_images/cds-01.png

Where “test_cds” is the name we put in our script example. Your order will be ready in /eodata/C3S/orders where token id is the same as in your order details. Time of ordering may depend on the size of file ordered. You can monitor the status in EO Finder.

../_images/cds-03.png