Python Examples#
DWD#
Observation#
Get available parameters for daily historical data of DWD:
1from wetterdienst.provider.dwd.observation import DwdObservationRequest
2
3metadata = DwdObservationRequest.discover(
4 resolutions="daily",
5)
6
7metadata
{'daily': {'climate_summary': [{'name': 'wind_gust_max',
'name_original': 'fx',
'unit_type': 'speed',
'unit': 'meter_per_second'},
{'name': 'wind_speed',
'name_original': 'fm',
'unit_type': 'speed',
'unit': 'meter_per_second'},
{'name': 'precipitation_height',
'name_original': 'rsk',
'unit_type': 'precipitation',
'unit': 'millimeter'},
{'name': 'precipitation_form',
'name_original': 'rskf',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'sunshine_duration',
'name_original': 'sdk',
'unit_type': 'time',
'unit': 'hour'},
{'name': 'snow_depth',
'name_original': 'shk_tag',
'unit_type': 'length_short',
'unit': 'centimeter'},
{'name': 'cloud_cover_total',
'name_original': 'nm',
'unit_type': 'fraction',
'unit': 'one_eighth'},
{'name': 'pressure_vapor',
'name_original': 'vpm',
'unit_type': 'pressure',
'unit': 'hectopascal'},
{'name': 'pressure_air_site',
'name_original': 'pm',
'unit_type': 'pressure',
'unit': 'hectopascal'},
{'name': 'temperature_air_mean_2m',
'name_original': 'tmk',
'unit_type': 'temperature',
'unit': 'degree_celsius'},
{'name': 'humidity',
'name_original': 'upm',
'unit_type': 'fraction',
'unit': 'percent'},
{'name': 'temperature_air_max_2m',
'name_original': 'txk',
'unit_type': 'temperature',
'unit': 'degree_celsius'},
{'name': 'temperature_air_min_2m',
'name_original': 'tnk',
'unit_type': 'temperature',
'unit': 'degree_celsius'},
{'name': 'temperature_air_min_0_05m',
'name_original': 'tgk',
'unit_type': 'temperature',
'unit': 'degree_celsius'}],
'precipitation_more': [{'name': 'precipitation_height',
'name_original': 'rs',
'unit_type': 'precipitation',
'unit': 'millimeter'},
{'name': 'precipitation_form',
'name_original': 'rsf',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'snow_depth',
'name_original': 'sh_tag',
'unit_type': 'length_short',
'unit': 'centimeter'},
{'name': 'snow_depth_new',
'name_original': 'nsh_tag',
'unit_type': 'length_short',
'unit': 'centimeter'}],
'solar': [{'name': 'radiation_sky_long_wave',
'name_original': 'atmo_strahl',
'unit_type': 'energy_per_area',
'unit': 'joule_per_square_centimeter'},
{'name': 'radiation_sky_short_wave_diffuse',
'name_original': 'fd_strahl',
'unit_type': 'energy_per_area',
'unit': 'joule_per_square_centimeter'},
{'name': 'radiation_global',
'name_original': 'fg_strahl',
'unit_type': 'energy_per_area',
'unit': 'joule_per_square_centimeter'},
{'name': 'sunshine_duration',
'name_original': 'sd_strahl',
'unit_type': 'time',
'unit': 'hour'}],
'temperature_soil': [{'name': 'temperature_soil_mean_0_02m',
'name_original': 'v_te002m',
'unit_type': 'temperature',
'unit': 'degree_celsius'},
{'name': 'temperature_soil_mean_0_05m',
'name_original': 'v_te005m',
'unit_type': 'temperature',
'unit': 'degree_celsius'},
{'name': 'temperature_soil_mean_0_1m',
'name_original': 'v_te010m',
'unit_type': 'temperature',
'unit': 'degree_celsius'},
{'name': 'temperature_soil_mean_0_2m',
'name_original': 'v_te020m',
'unit_type': 'temperature',
'unit': 'degree_celsius'},
{'name': 'temperature_soil_mean_0_5m',
'name_original': 'v_te050m',
'unit_type': 'temperature',
'unit': 'degree_celsius'},
{'name': 'temperature_soil_mean_1m',
'name_original': 'v_te100m',
'unit_type': 'temperature',
'unit': 'degree_celsius'}],
'water_equivalent': [{'name': 'snow_depth_excelled',
'name_original': 'ash_6',
'unit_type': 'length_short',
'unit': 'centimeter'},
{'name': 'snow_depth',
'name_original': 'sh_tag',
'unit_type': 'length_short',
'unit': 'centimeter'},
{'name': 'water_equivalent_snow_depth',
'name_original': 'wash_6',
'unit_type': 'precipitation',
'unit': 'millimeter'},
{'name': 'water_equivalent_snow_depth_excelled',
'name_original': 'waas_6',
'unit_type': 'precipitation',
'unit': 'millimeter'}],
'weather_phenomena': [{'name': 'count_weather_type_fog',
'name_original': 'nebel',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_thunder',
'name_original': 'gewitter',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_storm_strong_wind',
'name_original': 'sturm_6',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_storm_stormier_wind',
'name_original': 'sturm_8',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_dew',
'name_original': 'tau',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_glaze',
'name_original': 'glatteis',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_ripe',
'name_original': 'reif',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_sleet',
'name_original': 'graupel',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_hail',
'name_original': 'hagel',
'unit_type': 'dimensionless',
'unit': 'dimensionless'}],
'weather_phenomena_more': [{'name': 'count_weather_type_sleet',
'name_original': 'rr_graupel',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_hail',
'name_original': 'rr_hagel',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_fog',
'name_original': 'rr_nebel',
'unit_type': 'dimensionless',
'unit': 'dimensionless'},
{'name': 'count_weather_type_thunder',
'name_original': 'rr_gewitter',
'unit_type': 'dimensionless',
'unit': 'dimensionless'}]}}
Get stations for daily historical precipitation:
1from wetterdienst.provider.dwd.observation import DwdObservationRequest
2
3request = DwdObservationRequest(
4 parameters=("daily", "precipitation_more"),
5 periods="historical",
6)
7
8stations = request.all()
9df = stations.df
10df
| resolution | dataset | station_id | start_date | end_date | latitude | longitude | height | name | state |
|---|---|---|---|---|---|---|---|---|---|
| str | str | str | datetime[μs, UTC] | datetime[μs, UTC] | f64 | f64 | f64 | str | str |
| "daily" | "precipitation_more" | "00001" | 1912-01-01 00:00:00 UTC | 1986-06-30 00:00:00 UTC | 47.8413 | 8.8493 | 478.0 | "Aach" | "Baden-Württemberg" |
| "daily" | "precipitation_more" | "00002" | 1951-01-01 00:00:00 UTC | 2006-12-31 00:00:00 UTC | 50.8066 | 6.0996 | 138.0 | "Aachen (Kläranlage)" | "Nordrhein-Westfalen" |
| "daily" | "precipitation_more" | "00003" | 1891-01-01 00:00:00 UTC | 2011-03-31 00:00:00 UTC | 50.7827 | 6.0941 | 202.0 | "Aachen" | "Nordrhein-Westfalen" |
| "daily" | "precipitation_more" | "00004" | 1951-01-01 00:00:00 UTC | 1979-10-31 00:00:00 UTC | 50.7683 | 6.1207 | 243.0 | "Aachen-Brand" | "Nordrhein-Westfalen" |
| "daily" | "precipitation_more" | "00006" | 1982-11-01 00:00:00 UTC | 2026-07-08 00:00:00 UTC | 48.8361 | 10.0598 | 455.0 | "Aalen-Unterrombach" | "Baden-Württemberg" |
| … | … | … | … | … | … | … | … | … | … |
| "daily" | "precipitation_more" | "20107" | 2025-03-27 00:00:00 UTC | 2026-07-08 00:00:00 UTC | 49.9687 | 6.8272 | 311.0 | "Wittlich-Bergweiler" | "Rheinland-Pfalz" |
| "daily" | "precipitation_more" | "20108" | 2025-05-01 00:00:00 UTC | 2026-07-08 00:00:00 UTC | 51.1543 | 6.5049 | 56.0 | "Mönchengladbach-Schelsen" | "Nordrhein-Westfalen" |
| "daily" | "precipitation_more" | "20110" | 1969-01-01 00:00:00 UTC | 2005-07-31 00:00:00 UTC | 52.3183 | 11.5677 | 64.0 | "Colbitz" | "Sachsen-Anhalt" |
| "daily" | "precipitation_more" | "20189" | 2025-10-01 00:00:00 UTC | 2026-04-30 00:00:00 UTC | 47.6759 | 12.47 | 687.0 | "Reit im Winkl (Kaiserweg)" | "Bayern" |
| "daily" | "precipitation_more" | "20191" | 2025-09-01 00:00:00 UTC | 2026-07-08 00:00:00 UTC | 50.9238 | 14.357 | 375.0 | "Sebnitz-Hinterhermsdorf" | "Sachsen" |
Get data for a dataset:
1from wetterdienst.provider.dwd.observation import DwdObservationRequest
2
3request = DwdObservationRequest(
4 parameters=("daily", "precipitation_more"),
5 periods="historical",
6)
7
8first_values = next(request.all().values.query())
9df = first_values.df
10df
| station_id | resolution | dataset | parameter | date | value | quality |
|---|---|---|---|---|---|---|
| str | str | str | str | datetime[μs, UTC] | f64 | f64 |
| "00001" | "daily" | "precipitation_more" | "precipitation_form" | 1912-01-01 00:00:00 UTC | 0.0 | 1.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_form" | 1912-01-02 00:00:00 UTC | 1.0 | 1.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_form" | 1912-01-03 00:00:00 UTC | 0.0 | 1.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_form" | 1912-01-04 00:00:00 UTC | 1.0 | 1.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_form" | 1912-01-05 00:00:00 UTC | 7.0 | 1.0 |
| … | … | … | … | … | … | … |
| "00001" | "daily" | "precipitation_more" | "snow_depth_new" | 1986-06-26 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "precipitation_more" | "snow_depth_new" | 1986-06-27 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "precipitation_more" | "snow_depth_new" | 1986-06-28 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "precipitation_more" | "snow_depth_new" | 1986-06-29 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "precipitation_more" | "snow_depth_new" | 1986-06-30 00:00:00 UTC | 0.0 | 10.0 |
Get data for a parameter:
1from wetterdienst.provider.dwd.observation import DwdObservationRequest
2
3request = DwdObservationRequest(
4 parameters=("daily", "climate_summary", "precipitation_height"),
5 periods="historical",
6)
7
8first_values = next(request.all().values.query())
9df = first_values.df
10df
| station_id | resolution | dataset | parameter | date | value | quality |
|---|---|---|---|---|---|---|
| str | str | str | str | datetime[μs, UTC] | f64 | f64 |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1937-01-01 00:00:00 UTC | 0.0 | 5.0 |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1937-01-02 00:00:00 UTC | 0.0 | 5.0 |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1937-01-03 00:00:00 UTC | 0.0 | 5.0 |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1937-01-04 00:00:00 UTC | 0.0 | 5.0 |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1937-01-05 00:00:00 UTC | 0.0 | 5.0 |
| … | … | … | … | … | … | … |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1986-06-26 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1986-06-27 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1986-06-28 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1986-06-29 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "climate_summary" | "precipitation_height" | 1986-06-30 00:00:00 UTC | 0.0 | 10.0 |
Get data for a parameter from another dataset:
1from wetterdienst.provider.dwd.observation import DwdObservationRequest
2
3request = DwdObservationRequest(
4 parameters=[("daily", "precipitation_more", "precipitation_height")],
5 periods="historical",
6)
7
8first_values = next(request.all().values.query())
9df = first_values.df
10df
| station_id | resolution | dataset | parameter | date | value | quality |
|---|---|---|---|---|---|---|
| str | str | str | str | datetime[μs, UTC] | f64 | f64 |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1912-01-01 00:00:00 UTC | 0.0 | 1.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1912-01-02 00:00:00 UTC | 0.2 | 1.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1912-01-03 00:00:00 UTC | 0.0 | 1.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1912-01-04 00:00:00 UTC | 1.0 | 1.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1912-01-05 00:00:00 UTC | 2.1 | 1.0 |
| … | … | … | … | … | … | … |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1986-06-26 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1986-06-27 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1986-06-28 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1986-06-29 00:00:00 UTC | 0.0 | 10.0 |
| "00001" | "daily" | "precipitation_more" | "precipitation_height" | 1986-06-30 00:00:00 UTC | 0.0 | 10.0 |
Mosmix#
Get stations for MOSMIX-SMALL:
1from wetterdienst.provider.dwd.mosmix import DwdMosmixRequest
2
3request = DwdMosmixRequest(
4 parameters=("hourly", "small"),
5)
6
7stations = request.all()
8df = stations.df
9df
| resolution | dataset | station_id | icao_id | start_date | end_date | latitude | longitude | height | name | state |
|---|---|---|---|---|---|---|---|---|---|---|
| str | str | str | str | datetime[μs, UTC] | datetime[μs, UTC] | f64 | f64 | f64 | str | str |
| "hourly" | "small" | "01001" | "ENJA" | null | null | 70.93 | -8.67 | 10.0 | "JAN MAYEN" | null |
| "hourly" | "small" | "01008" | "ENSB" | null | null | 78.25 | 15.47 | 29.0 | "SVALBARD" | null |
| "hourly" | "small" | "01025" | null | null | null | 69.68 | 18.92 | 10.0 | "TROMSOE" | null |
| "hourly" | "small" | "01028" | "ENBJ" | null | null | 74.52 | 19.02 | 16.0 | "BJORNOYA" | null |
| "hourly" | "small" | "01049" | "ENAT" | null | null | 69.98 | 23.37 | 3.0 | "ALTA LUFTHAVN" | null |
| … | … | … | … | … | … | … | … | … | … | … |
| "hourly" | "small" | "Z944" | null | null | null | 47.65 | 12.82 | 1615.0 | "WARTSTEINHUETTE" | null |
| "hourly" | "small" | "Z946" | null | null | null | 47.57 | 12.97 | 1420.0 | "KUEHROINT" | null |
| "hourly" | "small" | "Z947" | null | null | null | 47.48 | 12.97 | 2520.0 | "FUNTENSEETAUERN" | null |
| "hourly" | "small" | "Z948" | null | null | null | 47.62 | 13.0 | 660.0 | "HOELLGRABEN" | null |
| "hourly" | "small" | "Z949" | null | null | null | 47.58 | 13.02 | 1200.0 | "JENNER" | null |
Get data for MOSMIX-LARGE:
1from wetterdienst.provider.dwd.mosmix import DwdMosmixRequest
2
3stations = DwdMosmixRequest(
4 parameters=("hourly", "large"),
5)
6
7stations = request.all()
8df = stations.df
9df
| resolution | dataset | station_id | icao_id | start_date | end_date | latitude | longitude | height | name | state |
|---|---|---|---|---|---|---|---|---|---|---|
| str | str | str | str | datetime[μs, UTC] | datetime[μs, UTC] | f64 | f64 | f64 | str | str |
| "hourly" | "small" | "01001" | "ENJA" | null | null | 70.93 | -8.67 | 10.0 | "JAN MAYEN" | null |
| "hourly" | "small" | "01008" | "ENSB" | null | null | 78.25 | 15.47 | 29.0 | "SVALBARD" | null |
| "hourly" | "small" | "01025" | null | null | null | 69.68 | 18.92 | 10.0 | "TROMSOE" | null |
| "hourly" | "small" | "01028" | "ENBJ" | null | null | 74.52 | 19.02 | 16.0 | "BJORNOYA" | null |
| "hourly" | "small" | "01049" | "ENAT" | null | null | 69.98 | 23.37 | 3.0 | "ALTA LUFTHAVN" | null |
| … | … | … | … | … | … | … | … | … | … | … |
| "hourly" | "small" | "Z944" | null | null | null | 47.65 | 12.82 | 1615.0 | "WARTSTEINHUETTE" | null |
| "hourly" | "small" | "Z946" | null | null | null | 47.57 | 12.97 | 1420.0 | "KUEHROINT" | null |
| "hourly" | "small" | "Z947" | null | null | null | 47.48 | 12.97 | 2520.0 | "FUNTENSEETAUERN" | null |
| "hourly" | "small" | "Z948" | null | null | null | 47.62 | 13.0 | 660.0 | "HOELLGRABEN" | null |
| "hourly" | "small" | "Z949" | null | null | null | 47.58 | 13.02 | 1200.0 | "JENNER" | null |
Radar#
Sites#
Retrieve information about all OPERA radar sites.
1from wetterdienst.provider.eumetnet.opera.sites import OperaRadarSites
2
3# Acquire information for all OPERA sites.
4sites = OperaRadarSites().all()
5print(f"Number of OPERA radar sites: {len(sites)}")
6
7# Acquire information for a specific OPERA site.
8site_ukdea = OperaRadarSites().by_odim_code("ukdea")
9site_ukdea
Number of OPERA radar sites: 205
{'number': 1312,
'country': 'United Kingdom',
'countryid': 'EGRR61',
'oldcountryid': 'UK61',
'wmocode': 3859,
'wigosid': None,
'odimcode': 'ukdea',
'location': 'Dean Hill',
'status': True,
'latitude': 51.0307,
'longitude': -1.6534,
'heightofstation': 155.0,
'band': 'C',
'doppler': True,
'polarization': 'D',
'maxrange': 255,
'startyear': 2005,
'heightantenna': 180.0,
'diametrantenna': 3.66,
'beam': 1.0,
'gain': 43.0,
'frequency': 5.627,
'stratus': None,
'cirusnimbus': None,
'wrwp': None}
Retrieve information about the DWD radar sites.
1from wetterdienst.provider.dwd.radar.api import DwdRadarSites
2
3# Acquire information for a specific site.
4site_asb = DwdRadarSites().by_odim_code("ASB")
5site_asb
{'number': 1389,
'country': 'Germany',
'countryid': 'EDZW40',
'oldcountryid': 'DL40',
'wmocode': 10103,
'wigosid': None,
'odimcode': 'deasb',
'location': 'Isle of Borkum',
'status': True,
'latitude': 53.564,
'longitude': 6.7482,
'heightofstation': 4.0,
'band': 'C',
'doppler': True,
'polarization': 'S',
'maxrange': 180,
'startyear': 2018,
'heightantenna': 36.2,
'diametrantenna': 2.4,
'beam': 1.57,
'gain': 41.55,
'frequency': 5.64,
'stratus': None,
'cirusnimbus': None,
'wrwp': None}
Data#
To use DWDRadarRequest, you have to provide a RadarParameter,
which designates the type of radar data you want to obtain. There is
radar data available at different locations within the DWD data repository:
For RADOLAN_CDC-data, the time resolution parameter (either hourly or daily)
must be specified.
The date_times (list of datetimes or strings) or a start_date
and end_date parameters can optionally be specified to obtain data
from specific points in time.
For RADOLAN_CDC-data, datetimes are rounded to HH:50min, as the
data is packaged for this minute step.
This is an example on how to acquire RADOLAN_CDC data using
wetterdienst and process it using wradlib.
For more examples, please have a look at examples/provider/dwd/radar.
1from wetterdienst.provider.dwd.radar import DwdRadarValues, DwdRadarParameter, DwdRadarResolution
2import wradlib as wrl
3
4radar = DwdRadarValues(
5 parameter=DwdRadarParameter.RADOLAN_CDC,
6 resolution=DwdRadarResolution.DAILY,
7 start_date="2020-09-04T12:00:00",
8 end_date="2020-09-04T12:00:00"
9)
10
11for item in radar.query():
12 # Decode data using wradlib.
13 data, attributes = wrl.io.read_radolan_composite(item.data)
14
15 # Do something with the data (numpy.ndarray) here.
16 break
17
18attributes
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[10], line 2
1 from wetterdienst.provider.dwd.radar import DwdRadarValues, DwdRadarParameter, DwdRadarResolution
----> 2 import wradlib as wrl
3
4 radar = DwdRadarValues(
5 parameter=DwdRadarParameter.RADOLAN_CDC,
ModuleNotFoundError: No module named 'wradlib'