Skip to content

Plotting and Summaries

The rules on this page summarise and visualise solved networks and write under results/{run}/.

Summaries

make_summary

Computes summary tables of costs, capacities, energy balances, prices and metrics.

Script, inputs, outputs and settings
  • Script: scripts/make_summary.py
  • Inputs: results/networks/solved_{...}.nc, results/networks/solved_{h}.nc
  • Outputs: results/csvs/nodal_costs.csv, results/csvs/nodal_capacities.csv, results/csvs/nodal_capacity_factors.csv, results/csvs/capacity_factors.csv, results/csvs/costs.csv, results/csvs/capacities.csv, results/csvs/curtailment.csv, results/csvs/energy.csv, results/csvs/energy_balance.csv, results/csvs/nodal_energy_balance.csv, results/csvs/prices.csv, results/csvs/weighted_prices.csv, results/csvs/market_values.csv, results/csvs/metrics.csv, results/csvs/cumulative_costs.csv
  • Settings: foresight, planning_horizons

Computes summary tables of costs, capacities, energy balances, prices and metrics.

Reads the solved networks of all planning horizons and evaluates them with the PyPSA statistics module, both system-wide and per region using the location of each component. The tables cover capital and marginal costs, optimal capacities, capacity factors, curtailment, energy balances, time-averaged and load-weighted prices, market values and system metrics such as grid volume and CO2 shadow prices. For pathways with several horizons, cumulative costs are also integrated over time for a range of social discount rates. The tables are the basis for the summary plots.

plot_summary

Plots stacked bar charts of system costs, energy and balances across planning horizons.

Script, inputs, outputs and settings

Plots stacked bar charts of system costs, energy and balances across horizons.

Reads the summary tables of the solved networks, groups technologies into coarser classes, drops entries below configurable thresholds and orders them consistently before stacking. One figure shows annual system cost, one the net energy supply and consumption per technology, and one per bus carrier its energy balance. Under perfect foresight, a further figure compares the modelled CO2 emission path with historical emissions and EU targets.

plot_base_statistics

Plots bar charts of capacities, costs, curtailment, supply and market values per carrier.

Script, inputs, outputs and settings
  • Script: scripts/plot_statistics.py
  • Inputs: results/networks/solved_{horizon}.nc
  • Outputs: results/figures/statistics_{plot}_bar_{{horizon}}.pdf, results/figures/.statistics_plots_{horizon}
  • Settings: plotting
  • Wildcards: {horizon}, {plot}

Plots bar charts of key statistics per technology carrier from a solved network.

Reads the solved network and computes capacity factors, installed and optimal capacities, capital and operational expenditure, curtailment, supply, withdrawal and market values with the PyPSA statistics module. Each statistic is drawn as a horizontal bar chart coloured by carrier, with loads shown as a carrier of their own. The charts give a quick sanity check of a single scenario's results.

Maps

plot_base_network

Plots the base transmission network topology with line and link capacities on a map.

Script, inputs, outputs and settings

Plots the base transmission network topology on a map.

Reads the base network and the onshore regions, draws region outlines and scales HVAC line widths by their thermal rating and HVDC link widths by their power rating. Legends with reference capacities are added for lines and links where present. The figure serves as a visual check of the imported grid before clustering.

plot_clustered_network

Plots the clustered transmission network with existing and planned HVDC links on a map.

Script, inputs, outputs and settings

Plots the clustered transmission network on a map.

Reads the clustered network and the onshore regions, draws region outlines, scales HVAC line widths by their thermal rating and colours HVDC links by whether they already exist or are only planned. The figure serves as a visual check of the spatial resolution and grid topology used in the optimisation.

plot_power_network

Plots the optimised power network with regional technology costs and grid expansion.

Script, inputs, outputs and settings

Plots the optimised power network with regional technology costs and grid expansion.

Reads the solved network and aggregates the annualised capital cost of generators, storage and conversion technologies per electricity bus, grouped into coarse technology classes and drawn as pie charts. HVAC lines and HVDC links are drawn with widths proportional to the capacity added by the optimisation. Small technologies and branches are hidden to keep the map readable. The map projection helper defined here is shared by the other map scripts.

plot_hydrogen_network

Plots the optimised hydrogen pipelines, storage, electrolysis and fuel cells on a map.

Script, inputs, outputs and settings

Plots the optimised hydrogen network, storage and conversion capacities on a map.

Reads the solved network and draws electrolysis and fuel cell capacities as circles per electricity bus, hydrogen pipeline capacities as line widths and regional hydrogen storage capacity as shaded regions. New and repurposed pipelines are shown in separate layers; under myopic foresight, pipelines from different investment periods between the same buses are summed. Pipelines below a capacity threshold are omitted, and networks without hydrogen pipelines produce a placeholder figure.

plot_gas_network

Plots the optimised methane pipeline network and regional gas sources on a map.

Script, inputs, outputs and settings
  • Script: scripts/plot_gas_network.py
  • Inputs: results/networks/solved_{horizon}.nc, resources/onshore_regions.geojson
  • Outputs: results/maps/static/ch4_network_{horizon}.pdf
  • Settings: plotting
  • Wildcards: {horizon}

Plots the optimised methane network and regional gas sources on a map.

Reads the solved network and aggregates annual fossil gas extraction, methanation and biogas supply per electricity bus as circle sizes. Gas pipelines are drawn in three layers: capacity existing in 2020, total available capacity after expansion, and the maximum flow actually used. Pipelines below a capacity threshold are omitted. Networks without gas pipelines produce a placeholder figure.

plot_balance_map

Plots a static map of the nodal energy balance, flows and prices for one bus carrier.

Script, inputs, outputs and settings

Plots a static map of the nodal energy balance of one bus carrier.

Reads the solved network and computes the annual energy balance per bus and technology carrier with the PyPSA statistics module, split into supply and consumption. Bus sizes show the balance as split circles, branch widths and arrows show net transmission flows, and regions are shaded by the time-averaged marginal price of the carrier. Transmission losses are removed from the balance. For stored CO2, dense-phase buses are merged into the balance and the CO2 emission shadow price is subtracted from the regional price. Carriers absent from the network produce a placeholder figure.

plot_balance_map_interactive

Plots an interactive map of the nodal energy balance, flows and prices for one bus carrier.

Script, inputs, outputs and settings

Plots an interactive HTML map of the nodal energy balance of one bus carrier.

Reads the solved network and computes the annual energy balance per bus and technology carrier with the PyPSA statistics module. Buses are drawn as split pie charts of supply and consumption, branches as arrows scaled by net transmission flow, and regions are shaded by the time-averaged marginal price. The map is rendered with pydeck through n.explore() and written as a self-contained HTML file with tooltips for inspection in a browser.

plot_heat_source_map

Plots interactive maps of heat source temperatures and energy potentials by region.

Script, inputs, outputs and settings
  • Script: scripts/plot_heat_source_map.py
  • Inputs: resources/onshore_regions.geojson, resources/temp_, resources/heat_source_energy_
  • Outputs: results/maps/static/heat_source_temperature_map_{carrier}_{horizon}.html, results/maps/static/heat_source_energy_map_{carrier}_{horizon}.html
  • Wildcards: {carrier}, {horizon}

Plots interactive maps of heat source temperatures and energy potentials by region.

Reads the temporally aggregated temperature and, where available, energy potential of a heat source such as river water, sea water or ambient air. Grid cell values are drawn as points and aggregated per onshore region, with temperatures averaged and energy potentials summed, and shown in tooltips. The maps are rendered with Folium as HTML files and serve to inspect the spatial distribution of heat sources available for district heating. Missing energy data yields an empty map.

Time series

plot_balance_timeseries

Plots stacked energy balance time series per carrier at annual and monthly resolution.

Script, inputs, outputs and settings

Plots stacked energy balance time series per bus carrier from a solved network.

Reads the solved network and computes the time-resolved energy balance per technology carrier with the PyPSA statistics module. Balances are grouped by bus carrier or by configured carrier groups, supply is stacked above and consumption below the zero line, and technologies with negligible contribution are lumped into "other". One figure is drawn for the whole year at coarse resolution and one per month at finer resolution, processed in parallel across carrier groups.

plot_heatmap_timeseries

Plots hour-by-day heatmaps of utilisation rates, marginal prices and storage levels.

Script, inputs, outputs and settings

Plots hour-of-day by day-of-year heatmaps of time series from a solved network.

Reads the solved network and reshapes each hourly time series into a grid of 24 hours by days of the year. Heatmaps are drawn for the utilisation rate of built technologies, the marginal price per bus carrier and the state of charge per storage carrier, each for a configured selection of carriers. Coarser snapshots are forward-filled to hourly resolution, and the script skips plotting if the snapshots contain a gap longer than a month.

plot_interactive_bus_balance

Plots interactive energy balance time series for each bus matching a name pattern.

Script, inputs, outputs and settings

Plots interactive energy balance time series for individual buses of a solved network.

Reads the solved network and, for every bus matching a name pattern, sums the dispatch of connected generators, storage units, stores, loads and links per carrier. Supply is stacked above and consumption below the zero line in a Plotly figure written as one HTML file per bus. The balance is computed directly from the component time series rather than with the PyPSA statistics module, and buses are processed in parallel.

Heating diagnostics

build_ambient_air_temperature_yearly_average

Averages ambient air temperature over the year for each onshore grid cell.

Script, inputs, outputs and settings

Build yearly average ambient air temperature raster data.

This script processes the ambient air temperature from the cutout data and calculates the yearly average for each grid cell. It only keeps temperatures within onshore regions and stores them as a unary region with coordinates longitude, latitude, and name.

plot_cop_profiles

Plots interactive heat pump coefficient of performance profiles per region.

Script, inputs, outputs and settings

Plot coefficient of performance (COP) profiles for heat pumps in different regions. Generates interactive HTML plots showing COP profiles for central heating.