Skip to content

Retrieving Data

Not all data dependencies are shipped with the git repository, since git is not suited for handling large changing files. Instead we use separate steps in the workflow (rules executed by snakemake) to download external data using the retrieve_<dataset> rules.

Data is generally retrieved in a version-controlled manner, enabling control over input data versions, reproducibility and consistency of modelling runs. The rules download data into subfolders in the data/ directory, following the structure data/{dataset}/{source}/{version}, e.g. data/jrc_idees/primary/March-2025-V1/. Which specific data version is retrieved can be controlled in the data configuration.

Every dataset is listed with its owner, link and license in the data inventory. Its available versions and sources (archive, primary or build) are registered in data/versions.csv. Most retrieve_<dataset> rules simply download the registered URL for the selected source. The rules below need more than that.

Rules requiring credentials

Credentials are read from environment variables. You can put them into a .env file in the repository root, which is loaded automatically and ignored by git.

Rule Requirement
build_cutout A Copernicus Climate Data Store account with the cdsapi key set up as described on their website. Only needed when data: cutout: source: build.
retrieve_electricity_demand_entsoe An ENTSO-E Transparency Platform API token in ENTSOE_API_TOKEN. Only needed when data: entsoe_electricity_demand: source: build.
retrieve_corine A Copernicus Land Monitoring Service API key in CORINE_API_TOKEN. Only needed when data: corine: source: primary.
retrieve_seawater_temperature Copernicus Marine Service credentials configured for the copernicusmarine package. Only needed when heat pumps use the sea_water heat source with a non-test cutout.
Example .env file

A .env file with all credentials looks like this. Only add the lines for the rules you run. The file is listed in .gitignore, so git does not commit it.

.env
# build_cutout: Copernicus Climate Data Store (alternative to ~/.cdsapirc)
CDSAPI_URL=https://cds.climate.copernicus.eu/api
CDSAPI_KEY=<your-personal-access-token>

# retrieve_electricity_demand_entsoe: ENTSO-E Transparency Platform
ENTSOE_API_TOKEN=<your-entsoe-token>

# retrieve_corine: Copernicus Land Monitoring Service
CORINE_API_TOKEN=<your-clms-api-key>

# retrieve_seawater_temperature: Copernicus Marine Service
COPERNICUSMARINE_SERVICE_USERNAME=<your-username>
COPERNICUSMARINE_SERVICE_PASSWORD=<your-password>

Rules with special handling

  • retrieve_cutout downloads pre-built weather cutouts; see cutouts.
  • retrieve_osm_data_raw queries the Overpass API per country when data: osm: source: build. The endpoint, retries and user agent are set under overpass_api.
  • retrieve_wdpa and retrieve_wdpa_marine resolve the monthly changing download URL of the World Database on Protected Areas. The data may not be redistributed, so the archive source points to a web archive copy.
  • retrieve_bidding_zones_entsoepy and retrieve_bidding_zones_electricitymaps download bidding zone shapes via the entsoe-py package and from Electricity Maps. They are combined by build_bidding_zones.
  • retrieve_cost_data downloads techno-economic assumptions from the technology-data repository as data/costs/{source}/{version}/costs_{horizon}.csv. The cost year can be fixed with costs: year: (see costs).

Electricity demand data

Historical hourly electricity demand is retrieved from three sources and combined by build_electricity_demand:

Rule Source Output
retrieve_electricity_demand_opsd OPSD platform, per country data/opsd_electricity_demand/{source}/{version}/electricity_demand_opsd_raw.csv
retrieve_electricity_demand_entsoe ENTSO-E Transparency Platform, per country data/entsoe_electricity_demand/{source}/{version}/electricity_demand_entsoe_raw.csv
retrieve_electricity_demand_neso NESO Data Portal, United Kingdom data/neso_electricity_demand/{source}/{version}/electricity_demand_neso_raw.csv

The spatial distribution of demand within countries uses: