- Polytope Examples for DT Data Access
This repository describes the process for accessing Destination Earth DT data via the Polytope web service hosted on the LUMI Databridge.
- Clone the repo locally or if using polytope via Insula
cdinto the polytope directory.
git clone git@github.com:destination-earth-digital-twins/polytope-examples.git
- Install polytope-client from PyPI:
pip install --upgrade polytope-client
- Retrieve a token from the Destination Earth Service Platform (DESP) by running the script included in this repository:
python desp-authentication.py -u <username> -p <password>
# see --help for more options
Or you can run the script without arguments
python desp-authentication.py
# see --help for more options
You will then be prompted to enter your username and password if no credentials are found in a config or through environment variables.
You will need some dependencies to run the script, which can be installed using pip:
pip install --upgrade lxml conflator
The script automatically places your token in ~/.polytopeapirc where the client will pick it up. The token is a long-lived ("offline_access") token.
- Run the example scripts in this repository to download data, and customise them as you wish.
You can run the notebooks by setting up an appropriate environment using one of the following options:
-
Option 1: Use the
environment.ymlfile to create a Conda environment, or -
Option 2: Use the
requirements.txtfile to set up a Python virtual environment.
After creating the environment, the provided commands will also register an IPython kernel named earthkit, which you can select when working with the notebooks.
envname=earthkit
conda create -n $envname -c conda-forge -y python=3.10
conda env update -n $envname -f environment.yml
conda activate $envname
# set earthkit environment to the default used by ipykernels
python3 -m ipykernel install --user --name=$envname
Requires Python 3.10 or higher. You can check your version with
python3 --version.
envname=earthkit
# Create a virtual environment (Python 3.10+ required)
python3 -m venv $envname
# Activate it
source $envname/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt
# If using Jupyter notebooks, register your environment as a kernel for ipykernel
python3 -m ipykernel install --user --name=$envname
Data can be found on both LUMI and MN5, to access data on either change the address argument in earthkit.data.from_source() to either polytope.mn5.apps.dte.destination-earth.eu for MN5 or polytope.lumi.apps.dte.destination-earth.eu for LUMI.
- Climate DT Example Directory — see also the Climate DT README for full details on available data and variables.
climate-dt/
├── explorer/ # Browse the Climate DT data portfolio lazily without downloading upfront
├── feature-extraction/ # Extract specific spatial or temporal features from the datacube
├── full-field/ # Retrieve and visualise complete global or regional fields
└── full-field-post-processing/ # Apply server-side or client-side post-processing to retrieved fields
Polytope allows users to download complete global or regional fields from the Climate DT. Full field requests return GRIB data using standard MARS keys. Server-side options such as grid (interpolation to a target grid) and area (geographic subselection) can be applied at request time to reduce data volume before download. See the Polytope full fields documentation for more details.
- Climate DT python Script
- Climate DT notebook example
- Climate DT notebook domain example
- Climate DT notebook area example
- Climate DT notebook area of interest example
- Climate DT notebook grid example
- Climate DT notebook healpix data
- Climate DT notebook healpix ocean
- Climate DT notebook HighResMIP example
- Climate DT monthly means notebook example
These notebooks demonstrate server-side and client-side post-processing of retrieved fields, including grid interpolation, and format conversion.
- Climate DT notebook healpix interpolation
- Climate DT notebook serverside interpolation
- Climate DT notebook GeoTIFF export
Polytope feature extraction reads only the user-requested data rather than whole fields, which significantly reduces I/O. Features are n-dimensional shapes (polytopes) cut from the datacube — such as time series at a point, vertical profiles, trajectories, bounding boxes, and polygons. See the Polytope feature extraction documentation for more details.
- Climate DT notebook feature extraction timeseries
- Climate DT notebook feature extraction trajectory
- Climate DT notebook feature extraction vertical profile
- Climate DT notebook feature extraction bounding box
- Climate DT notebook feature extraction country
- Climate DT notebook feature extraction polygon
- Climate DT notebook feature extraction pcolormesh
- Climate DT notebook feature extraction nudging story
- Climate DT notebook feature extraction monthly mean timeseries (baseline)
- Climate DT notebook feature extraction monthly mean timeseries (projections)
- Climate DT notebook feature extraction monthly mean polygon (baseline)
- Climate DT notebook feature extraction monthly mean polygon (projections)
The Climate DT Explorer notebooks allow you to lazily browse the full Climate DT data portfolio without downloading any data upfront. They expose the datacube as a virtual zarr store backed by Polytope, so you can inspect available variables, perform climate change analysis over multi-decadal periods, and generate ready-to-use request snippets — only fetching the data chunks you actually need.
- Climate DT lazy portfolio browser (monthly)
- Climate DT lazy portfolio browser (hourly)
- Climate DT climate change analysis
- Climate DT variable lookup
- Extremes DT Example Directory
- Full Field
- Full Field Post-Processing
- Feature Extraction
- Extremes DT notebook feature extraction timeseries
- Extremes DT notebook feature extraction trajectory
- Extremes DT notebook feature extraction 4D trajectory
- Extremes DT notebook feature extraction vertical profile
- Extremes DT notebook feature extraction bounding box
- Extremes DT notebook feature extraction country
- Extremes DT notebook feature extraction polygon
- Extremes DT notebook feature extraction pcolormesh
- Extremes DT notebook feature extraction polygon using H3
- Extremes DT notebook feature extraction wave
- On-Demand Extremes DT Example Directory
- Full Field
- Feature Extraction
- NextGEMS Example Directory
- Full Field
- Feature Extraction
General information about the Polytope Web service and how to use it can be found here: https://polytope.readthedocs.io/en/latest/Service/Full_fields/
To ensure system stability and fair usage, the following operational limits are enforced:
- API Rate Limit: Up to 50 requests per second. This limit may be adjusted based on system usage.
- Concurrent Operations Limit: A maximum of 5 download requests can be active at the same time.
Please plan your usage accordingly to avoid interruptions.
