.. _impact_sector_apps:
Impact Sector Applications
==========================
The Climate DT includes six impact-sector applications that process
climate model output to derive sector-specific indicators. These
applications are aligned with the
`Destination Earth use cases `_
and operate as integrated components of the Climate DT workflow.
The applications deliver information at the spatial and temporal
resolution of the Climate DT simulations and have been developed
in collaboration with users from relevant sectors.
.. toctree::
:maxdepth: 1
:hidden:
energy_indicators/index
energy_offshore/index
wildfires_wise/index
wildfires_fwi/index
hydroland/index
hydromet/index
.. list-table::
:widths: 20 80
* - .. image:: ../figures/energy_indicators_logo.png
:width: 150px
- :ref:`Energy Indicators `
Derives wind and solar energy metrics from Climate DT simulations.
Outputs include wind speed at hub height, wind and photovoltaic
capacity factors, heating and cooling degree days, and wind-related
extreme-event metrics. Indicators are produced at kilometre-scale
resolution and are available globally.
* - .. image:: ../figures/wind_turbine_stock_image.png
:width: 150px
- :ref:`Energy Offshore `
Provides wind statistics and related indicators tailored to offshore
wind energy applications.
* - .. image:: ../figures/wildfires_stock_image1.png
:width: 150px
- :ref:`Wildfires FWI ` and :ref:`Wildfires WISE `
Combines the Canadian Forest Fire Weather Index (FWI) with the
Wildfire Intelligence and Simulation Engine (WISE). FWI provides
daily fire-weather danger metrics at continental to global scales,
while WISE simulates localised fire spread at high spatial and temporal
resolution.
* - .. image:: ../figures/hydroland_stock_image.png
:width: 150px
- :ref:`HydroLand `
Provides information on freshwater availability using the mesoscale
Hydrologic Model (mHM) driven by Climate DT output. Key variables
include river discharge and soil moisture, from which drought and
flood-related indices are derived.
* - .. image:: ../figures/ai_flood_image.png
:width: 150px
- :ref:`HydroMet `
Derives extreme precipitation statistics from Climate DT simulations,
including event catalogues and intensity estimates for specified
return periods and durations. The application supports infrastructure
planning and climate risk assessment.
Integration within the Climate DT Workflow
------------------------------------------
Impact-sector applications are integrated within the Climate DT production workflow and process data as it is generated by the coupled models (see :numref:`apps_in_workflow`). The output from all three models can be processed the same way by the apps due to the Generic State Vector (GSV) that unifies the model output to a large extent. Before the data is processed by the applications the data goes through the One-pass Algorithm and potentially through Bias adjustment.
.. figure:: ../figures/climatedt_apps_schematic.png
:alt: Schematic of impact-sector applications within the Climate DT workflow
:figwidth: 50%
:name: apps_in_workflow
:align: right
Schematic of impact-sector applications within the Climate DT workflow.
**One-Pass Algorithm (OPA)**
The OPA incrementally computes statistical metrics as data becomes
available, without requiring access to the full temporal record.
Available statistics include percentiles, histograms and annual maxima.
**Bias Adjustment (BA)**
Bias adjustment can be applied to selected variables using quantile
mapping against reference datasets. This component operates within
the streaming workflow and is primarily applied to precipitation and
temperature. Currently, only HydroLand uses Bias Adjustment.
Accessing the data
------------------
.. note::
Information on accessing the data for this application will be
published in an upcoming update. For access to Climate DT
simulation data, see :ref:`model_data`.
.. Data from the applications can be accessed via the Harmonised
.. Data Access (HDA). The following are required:
.. - DESP account with upgraded access
.. - the ``destinelab`` Python package
.. - the unique identifier of the desired dataset ("EO.DWD.STAT.HYDROMET_EXTREMES" for example)
.. To register for a DESP account, go to the `Destine Platform `_ and create a user account.
.. Afterwards, you can apply for `upgraded access `_ ,
.. which grants you access to the original Climate DT model output and the derived use case output.
.. An overview of all available datasets and their description is available at the
.. `Data Lake portfolio `_. Use the search field to find any keyword or use
.. one of the filters on the left side. To view all available datasets, a DESP account login is required.
.. Once a dataset is selected, users can use their own environment on any machine with internet access or use the
.. preconfigured JupyterHub `Insula Code `_.
.. To analyse the data, the destinelab package is required. It is available on PyPI and can be installed with
.. .. code::
.. pip install destinelab
.. The key steps are summarised below. For a complete walkthrough, see the
.. `DestinE DataLake Lab example notebook `_
.. for a generic example, or this
.. `HydroMet-specific example notebook
.. for an application-tailored walkthrough.
.. 1. Authentication
.. .. code::
.. import requests
.. import json
.. from getpass import getpass
.. import destinelab as deauth
.. from IPython.display import JSON
.. DESP_USERNAME = input("Please input your DESP username or email: ")
.. DESP_PASSWORD = getpass("Please input your DESP password: ")
.. auth = deauth.AuthHandler(DESP_USERNAME, DESP_PASSWORD)
.. access_token = auth.get_token()
.. auth_headers = {"Authorization": f"Bearer {access_token}"}
.. Running the code above prompts the user for their username and password and authenticates them.
.. 2. Search
.. After successful authentication, you can search for the actual dataset. Results are written out in the JSON format.
.. .. code::
.. BODY = {
.. "collections": [
.. "EO.DWD.STAT.HYDROMET_EXTREMES",
.. ]
.. }
.. r=requests.post("https://hda.data.destination-earth.eu/stac/v2/search", json=BODY, headers=auth_headers)
.. if(r.status_code!= 200):
.. (print(r.text))
.. r.raise_for_status()
.. JSON(r.json(), expanded=False)
.. print(json.dumps(r.json(), indent=4))
.. 3. Download
.. The JSON contains download links that can be clicked for direct use or incorporated in a Python workflow.
.. The following downloads the first entry of the JSON file.
.. .. code::
.. #select the first item in the result to download
.. product = r.json()["features"][0]
.. # DownloadLink is an asset representing the whole product
.. download_url = product["assets"]["downloadLink"]["href"]
.. ITEM_ID = product["id"]
.. response = requests.get(download_url,stream=True,headers=auth_headers)
.. # If the request was successful, download the file
.. if (response.status_code == 200):
.. print("Downloading ...")
.. filename = ITEM_ID + ".zip"
.. with open(filename, 'wb') as f:
.. for chunk in response.iter_content(chunk_size=1024):
.. if chunk:
.. f.write(chunk)
.. f.flush()
.. print("The dataset has been downloaded to: {}".format(filename))
.. else: print("Request Unsuccessful! Error-Code: {}".format(response.status_code))