DEDL - HDA Extreme DT Parameter Plotter - Tutorial#

Author: EUMETSAT
Copyright: 2024 EUMETSAT
Licence: MIT

Credit: Earthkit and HDA Polytope used in this context are both packages provided by the European Centre for Medium-Range Weather Forecasts (ECMWF).

DEDL Harmonised Data Access is used in this example to access and plot Extreme DT parameter.

Documentation DestinE DataLake HDA

Extreme DT overview (for DESP testing period)

Import the required packages#

pip install --quiet --upgrade destinelab
Note: you may need to restart the kernel to use updated packages.

Import the Climate DT parameter & scenario dictionary

from destinelab import extreme_dt_dictionary
import ipywidgets as widgets
import json
import datetime

Extreme DT parameter selection (we limit the plotting to one parameter)#

# Create search box
search_box = widgets.Text(placeholder='Search by parameter name', description='Search:', disabled=False)

# Create dropdown to select entry
entry_dropdown = widgets.Dropdown(
    options=[(entry['paramName'], i) for i, entry in enumerate(extreme_dt_dictionary.extremeDT_params)],
    description='Select Entry:'
)

def filter_entries(search_string):
    return [(entry['paramName'], i) for i, entry in enumerate(extreme_dt_dictionary.extremeDT_params) if search_string.lower() in entry['paramName'].lower()]

def on_search_change(change):
    search_string = change.new
    if search_string:
        filtered_options = filter_entries(search_string)
        entry_dropdown.options = filtered_options
    else:
        entry_dropdown.options = [(entry['paramName'], i) for i, entry in enumerate(extreme_dt_dictionary.extremeDT_params)]

search_box.observe(on_search_change, names='value')

# Display widgets
display(search_box, entry_dropdown)

def get_selected_entry():
    return entry_dropdown.value