Electricity Demand and Supply¶
The rules on this page prepare the electricity demand time series, the existing power plant fleet and the potentials and availability profiles of wind, solar and hydro power. Their outputs are attached to the clustered network by compose_network.
Demand¶
build_electricity_demand_base¶
Distributes national electricity demand to simplified network regions by spatial keys.
Script, inputs, outputs and settings
- Script:
scripts/build_electricity_demand_base.py - Inputs:
resources/networks/simplified.nc,resources/onshore_regions_simplified.geojson, output ofretrieve_electricity_demand_energy_atlas, output ofretrieve_desnz_electricity_consumption, output ofretrieve_ons_lad,resources/nuts3_shapes.geojson,resources/electricity_demand.csv - Outputs:
resources/electricity_demand_simplified.nc - Settings:
load.distribution_key,load.substation_only
Distributes national electricity demand time series to the regions of the simplified network.
Each country's hourly load is split among its regions with distribution keys: the JRC Energy Atlas demand raster for EU countries, local authority consumption statistics for Great Britain, and a weighted mix of NUTS3 GDP and population elsewhere. NUTS3 and local authority attributes are reassigned to regions in proportion to overlapping area. Optionally only regions of low-voltage substations receive load. The result is a time-by-bus array of demand in MW.
build_electricity_demand¶
Builds national hourly electricity demand time series from ENTSO-E, OPSD and NESO data.
Script, inputs, outputs and settings
- Script:
scripts/build_electricity_demand.py - Inputs: output of
retrieve_electricity_demand_opsd, output ofretrieve_electricity_demand_neso, output ofretrieve_electricity_demand_entsoe, output ofretrieve_synthetic_electricity_demand - Outputs:
resources/electricity_demand.csv - Settings:
snapshots,enable.drop_leap_day,countries,load
This rule downloads the load data from Open Power System Data Time series. For all countries in
the network, the per country load timeseries are extracted from the dataset.
After filling small gaps linearly and large gaps by copying time-slice of a
given period, the load data is exported to a .csv file.
cluster_electricity_demand¶
Aggregates simplified per-bus electricity demand to clustered network buses.
Script, inputs, outputs and settings
- Script:
scripts/cluster_electricity_demand.py - Inputs:
resources/electricity_demand_simplified.nc,resources/busmap_cluster_network.csv - Outputs:
resources/electricity_demand.nc
Aggregate the electricity demand time series of the simplified network to the buses of the clustered network.
The per-bus demand of the simplified network is summed over the buses that the clustering busmap merges into each clustered bus, so that compose_network can attach the load directly without a clustering step.
Power plants¶
build_powerplants¶
Assigns conventional power plant capacities from powerplantmatching to clustered buses.
Script, inputs, outputs and settings
- Script:
scripts/build_powerplants.py - Inputs:
resources/networks/clustered.nc,resources/onshore_regions.geojson,resources/offshore_regions.geojson, output ofretrieve_powerplants,data/custom_powerplants.csv - Outputs:
resources/powerplants.csv - Settings:
electricity.powerplants_filter,electricity.custom_powerplants,electricity.everywhere_powerplants,countries
Build a table of existing conventional power plants assigned to the buses of the clustered network.
Plant capacities and locations come from the
powerplantmatching database,
restricted to the modelled countries and filtered with the
pandas.query
expression in electricity.powerplants_filter. Custom entries from a
user-provided CSV can be added, filtered with electricity.custom_powerplants;
for example powerplants_filter: Country not in ['Germany'] together with
custom_powerplants: Country in ['Germany'] replaces the German fleet by custom
data. Fuel types listed in electricity.everywhere_powerplants are added with
zero capacity at every bus. Each plant is assigned to the bus whose onshore or
offshore region contains it, or to the nearest region of the same country
within 10 km; plants that cannot be assigned are dropped with a warning.
The table keeps the powerplantmatching fields (name, fuel type, technology, country, capacity in MW, commissioning and retrofit year, coordinates and dam information, see the powerplantmatching README) and adds the assigned bus.

Renewable potentials and profiles¶
build_ship_raster¶
Crops the global ship traffic density raster to the cutout extent.
Script, inputs, outputs and settings
- Script:
scripts/build_ship_raster.py - Inputs: output of
retrieve_ship_raster, depends on configuration - Outputs:
resources/shipdensity_raster.tif
Transforms the global ship density data from the World Bank Data Catalogue to the size of the considered cutout to reduce computation time. The global ship density raster is later used for the exclusion when calculating the offshore potentials.
build_natura_raster¶
Downloads the Natura 2000 shapes from the EEA and rasterises them onto the cutout grid.
Script, inputs, outputs and settings
- Script:
scripts/build_natura.py - Inputs: depends on configuration
- Outputs: depends on configuration
Rasterises the Natura 2000 natural protection areas onto the extent of the weather cutout.
The Natura 2000 shapefile is unpacked, projected to the European LAEA grid (EPSG:3035) and burned into a binary raster with 100 m resolution covering the cutout extent. The raster serves as an exclusion layer in the land availability calculations, which is much faster than intersecting the vector data directly.
determine_availability_matrix¶
Computes the share of each cutout grid cell available to a renewable technology from land use data.
Script, inputs, outputs and settings
- Script:
scripts/determine_availability_matrix.py - Inputs: depends on configuration, output of
retrieve_corine, output ofretrieve_luisa_land_cover, output ofretrieve_gebco,resources/shipdensity_raster.tif,resources/country_shapes.geojson,resources/offshore_shapes.geojson,resources/onshore_regions.geojson,resources/offshore_regions.geojson - Outputs:
resources/availability_matrix_{technology}.nc,resources/availability_matrix_{technology}.png - Settings:
renewable,atlite.plot_availability_matrix - Wildcards:
{technology}
Determine the share of each cutout grid cell that is available for one renewable technology in each network region.
Land eligibility is computed with atlite by excluding rasters and geometries: selected classes of the CORINE Land Cover inventory (44 land use classes at 100 m resolution) and of the similar 50 m LUISA Base Map, optionally with a buffer distance around some classes; Natura 2000 nature reserves; and for offshore wind, water depths from the GEBCO bathymetry, shipping lane density and distance to the shore. Onshore regions are used for onshore technologies and offshore regions for offshore wind. For Moldova and Ukraine, areas not covered by CORINE are overwritten with externally determined availabilities.


determine_availability_matrix_MD_UA¶
Computes land availability for renewables in Ukraine and Moldova from Copernicus land cover.
Script, inputs, outputs and settings
- Script:
scripts/determine_availability_matrix_MD_UA.py - Inputs: output of
download_copernicus_land_cover, output ofretrieve_wdpa, output ofretrieve_wdpa_marine, output ofretrieve_gebco,resources/shipdensity_raster.tif,resources/country_shapes.geojson,resources/offshore_shapes.geojson,resources/onshore_regions.geojson,resources/offshore_regions.geojson, depends on configuration - Outputs:
resources/availability_matrix_MD-UA_{technology}.nc,resources/availability_matrix_MD-UA_{technology}.png - Settings:
renewable,atlite.plot_availability_matrix - Wildcards:
{technology}
Computes the land availability matrix for renewable generators in Ukraine and Moldova, which the default European land cover datasets do not cover.
For each technology, exclusion criteria are assembled from the Copernicus Global Land Cover raster (emulating the CORINE classes used elsewhere), protected areas from the World Database on Protected Areas (with point records buffered to their reported area), GEBCO bathymetry for maximum water depth, distance to shore and shipping density. The share of each cutout grid cell available to each region is then computed with atlite. The result is merged into the availability matrix of the other countries.
build_renewable_profiles¶
Computes {technology} capacity factors, potentials and grid distances per region.
Script, inputs, outputs and settings
- Script:
scripts/build_renewable_profiles.py - Inputs:
resources/availability_matrix_{technology}.nc,resources/offshore_shapes.geojson,resources/onshore_regions.geojson,resources/offshore_regions.geojson, depends on configuration - Outputs:
resources/profile_{technology}.nc,resources/regions_by_class_{technology}.geojson - Settings:
snapshots,enable.drop_leap_day,renewable - Wildcards:
{technology}
Build per-region capacity factor time series, installable potential and average grid distance for one renewable technology.
The script works at two resolutions: the cutout grid cells of the weather data and the coarser network regions. For each grid cell it computes the average capacity factor with atlite and takes the eligible land share from determine_availability_matrix. Within each region the cells are split into a configurable number of resource classes by capacity factor, and the capacity layout is assumed proportional to eligible area and capacity factor, since more capacity is expected where the resource is better. This layout weights the hourly cell time series into one profile per region and class; the installable potential sums the eligible area times the configured capacity density; and the average distance of the layout-weighted cells is measured to the region's representative point for onshore technologies and to the shoreline for offshore wind. If several turbine or panel models are configured by year, one profile per model year is produced. Regions with too little potential or too low a capacity factor are dropped.
| Field | Dimensions | Description |
|---|---|---|
| profile | year, bus, bin, time | Hourly availability factor per unit of installed capacity |
| p_nom_max | bus, bin | Maximal installable capacity in MW |
| average_distance | bus, bin | Average distance in km of the units to the grid bus (onshore) or the shoreline (offshore) |







build_solar_rooftop_potentials¶
Computes solar rooftop potentials per resource class for all clustered model regions.
Script, inputs, outputs and settings
- Script:
scripts/build_solar_rooftop_potentials.py - Inputs:
resources/pop_layout_total.nc,resources/regions_by_class_solar.geojson, depends on configuration - Outputs:
resources/solar_rooftop_potentials.csv
Build solar rooftop capacity potentials per clustered region and resource class.
The gridded total population layout is summed over each solar resource class region using the cutout indicator matrix. The potential assumes 20 m2 of usable roof area per person and 0.1 kW per m2, i.e. 2 kW per person. The result in MW caps the solar rooftop capacity expansion in the network.
build_country_runoff¶
Computes daily runoff per country from ERA5 cutouts to fill missing EIA hydro statistics.
Script, inputs, outputs and settings
- Script:
scripts/build_country_runoff.py - Inputs: depends on configuration,
resources/country_shapes.geojson - Outputs: depends on configuration
Build daily hydro runoff for each country to fill missing EIA statistics for hydro generation.
The resulting table has the following structure:
| Field | Dimensions | Unit | Description |
|---|---|---|---|
| index/time | time | day | Datestamp, YYYY-MM-DD |
| <columns> | country | ISO-3166 A2 | Daily total runoff (volume per area) per country |
build_hydro_profile¶
Builds hydro inflow time series per country from runoff scaled to EIA generation statistics.
Script, inputs, outputs and settings
- Script:
scripts/build_hydro_profile.py - Inputs:
resources/country_shapes.geojson,data/eia_hydro_annual_generation.csv,data/eia_hydro_annual_capacity.csv, depends on configuration - Outputs:
resources/profile_hydro.nc - Settings:
renewable.hydro,countries,snapshots,enable.drop_leap_day
Build hydroelectric inflow time series per country.
Runoff from the weather cutout is aggregated over each country shape with atlite, smoothed and normalised so that the annual inflow matches the annual hydro generation reported by the U.S. Energy Information Administration (EIA). Optionally, the EIA statistics are corrected for capacity changes relative to 2019, missing years are approximated by a linear regression of generation on annual runoff, and all years can be normalised to a single reference year. Years without EIA data default to the median year. Inflows below a configurable threshold are clipped to zero.
| Field | Dimensions | Description |
|---|---|---|
| inflow | countries, time | Inflow to the state of charge in MW, e.g. river inflow to hydro reservoirs |

