Open Data

Ensemble Tools provide few functions to download meteorological data from the opendata website provided by DWD.

Command Line Interface

enstools-compression

Command line interface for enstools.opendata. Currently only data from DWD is available.

usage: enstools-compression [-h] {retrieve,query} ...
-h, --help

show this help message and exit

enstools-compression query

usage: enstools-compression query [-h] [--get-models] [--get-init-times]
                                  [--get-vars] [--get-level-types]
                                  [--get-levels] [--get-lead-times]
                                  [--model MODEL] [--grid-type GRID_TYPE]
                                  [--level-type LEVEL_TYPE]
                                  [--init-time INIT_TIME]
                                  [--variable VARIABLE [VARIABLE ...]]
                                  [--levels LEVELS [LEVELS ...]]
                                  [--lead-time LEAD_TIME [LEAD_TIME ...]]
-h, --help

show this help message and exit

--get-models

list available models.

--get-init-times

list available init times. Requires argument –model and accepts –grid-type.

--get-vars

list of available variables for –model, –grid-type, and –init-time.

--get-level-types

get the available types of vertical levels for –model, –grid-type, –init-time, and –variable.

--get-levels

get the available vertical levels for –model, –grid-type, –init-time, –variable, and –level-type.

--get-lead-times

get the available times since model start for –model, –grid-type, –init-time, and –level-type.

--model <model>

name of the model to use. Use query –get-models to get a list of valid names.

--grid-type <grid_type>

type of the grid to use.

--level-type <level_type>

type of the vertical level to use.

--init-time <init_time>

initialization time to use. Integers are interpreted as hours since model start, dates formatted as YYYY-MM-DDTHH:MM are interpreted as absolute start dates.

--variable <variable>

name of the variable to use. Use query –get-vars to get a list of valid names.

--levels <levels>

levels to use.

--lead-time <lead_time>

lead times to use in hours.

enstools-compression retrieve

usage: enstools-compression retrieve [-h] [--dest DEST] [--merge]
                                     [--model MODEL] [--grid-type GRID_TYPE]
                                     [--level-type LEVEL_TYPE]
                                     [--init-time INIT_TIME]
                                     [--variable VARIABLE [VARIABLE ...]]
                                     [--levels LEVELS [LEVELS ...]]
                                     [--lead-time LEAD_TIME [LEAD_TIME ...]]
-h, --help

show this help message and exit

--dest <dest>

destination folder for downloaded data.

--merge

merge multiple downloaded files.

--model <model>

name of the model to use. Use query –get-models to get a list of valid names.

--grid-type <grid_type>

type of the grid to use.

--level-type <level_type>

type of the vertical level to use.

--init-time <init_time>

initialization time to use. Integers are interpreted as hours since model start, dates formatted as YYYY-MM-DDTHH:MM are interpreted as absolute start dates.

--variable <variable>

name of the variable to use. Use query –get-vars to get a list of valid names.

--levels <levels>

levels to use.

--lead-time <lead_time>

lead times to use in hours.

Python API

This small example downloads total precipitation data from ICON-EU for 0,6,12,18 and 24 forecast hours.

from enstools.opendata import retrieve_nwp

# download the ICON-EU 24h forecast from today 00 UTC.
grib_file = retrieve_nwp(variable=["tot_prec"],
                         model="icon-eu",
                         grid_type="regular-lat-lon",
                         level_type="single",
                         init_time=0,
                         forecast_hour=[0,6,12,18,24],
                         dest="data",
                         merge_files=True)

for more details: Open Data API.