Skip to content

Commit

Permalink
Add 2024 DFES files
Browse files Browse the repository at this point in the history
  • Loading branch information
slowe committed Jan 28, 2025
1 parent eaac9ea commit b5ce871
Show file tree
Hide file tree
Showing 210 changed files with 93,867 additions and 0 deletions.
27 changes: 27 additions & 0 deletions 2024-DFES/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Northern Powergrid Future Energy Scenarios 2024

**This directory contains a prototype tool and none of the data should be taken as real or representative of the scenarios listed.**

## About this visualisation

### Future Energy Scenarios 2024
Four of the scenarios presented are aligned with Nationalgrid|ESO's [Future Energy Scenarios](https://www.nationalgrideso.com/future-energy/future-energy-scenarios):

* Counterfactual
* Hydrogen Evolution
* Electric Engagement
* Holistic Transition
* NPg Reference Scenario

### Geographies

We [have created](https://odileeds.org/blog/2019-11-27-building-electricity-distribution-geography) [geographies (polygons) for each Primary substation](https://odileeds.github.io/northern-powergrid/2020-emerging-thinking/data/maps/primaries-unique.geojson) in Northern Powergrid's network. These were built up using [Output Areas](https://www.ons.gov.uk/methodology/geography/ukgeographies/censusgeographies/census2021geographies#output-areas-oas-) as these are the building blocks of census geography as used by the [Office of National Statistics](https://www.ons.gov.uk/). We have used customer postcodes to identify each Output Area supplied by each Primary substation. Output Areas with fewer than 10 customers connected to a Primary substation were excluded. This helped with anonymisation and also reduced data issues in the customer database e.g. incorrect customer postcodes. We construct representative geographies for each Primary substation from the remaining Output Areas. In cases where multiple Primary substations serve the same Output Area, that Output Area is assigned to the Primary substation that serves the most customers there. In 2023 we recreated the geographies using 2021 census Output Areas.

Some Primary substation geographies may show larger areas on the map than they cover in practice particularly in rural areas where network connectivity may be concentrated in specific parts of an Output Area. The areas shown here are representative for the purpose of showing the Future Energy Scenario model data and should not be relied upon for checking connectivity or to assess the terms of connection for specific premises.

### Local Authority view

The model predictions have been created by Primary substation and that is the definitive view. The Local Authority view is constructed from the Primary substation values. We have found the proportion of a Primary substation's customers in each Local Authority district (as defined in April 2019) by adding up the customers in each Output Area belonging to a specific Local Authority district. For some parameters (e.g. electric vehicles) the values from the Primary substations are apportioned to each Local Authority District and then summated into totals. For values which can't be summated (e.g. Peak demand) we have shown the maximum value for any Primary substation that serves a Local Authority. For Local Authorities which are only partially in Northern Powergrid areas the model only produces forecasts for the area served by Northern Powergrid, so it is not a total Local Authority forecast. Examples of these Local Authorities partially served by Northern Powergrid include Bassetlaw, East Lindsey, High Peak, North East Derbyshire, North East Lincolnshire, North Lincolnshire, Pendle, West Lindsey. There are some additional major sites situated within a Local Authority area which distribute into many Local Authority areas and which may have further direct connections for large wind, solar and other generation. Data for these Grid Supply Points (connection points between the GB transmission network and Northern Powergrid’s distribution network) and Bulk Supply Points (connection points on NPg's network which are fed from the Grid Supply Points and supply the primary substations) can also be downloaded from Data Mill North.
Data

The Primary substation [data files](data/) that power this visualisation are stored within this repository.
49 changes: 49 additions & 0 deletions 2024-DFES/data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Future Energy Scenario Data

Element Energy create yearly predictions for each Primary sub-station over a variety of `parameters` for several `scenarios`. The data are stored in separate files - one for each `scenario`/`parameter` combination - within the [scenarios/primaries](scenarios/primaries/) sub-directory.

## Files

The following files are in this directory:

* [colours.csv](colours.csv) - this is used to define the colours used for lines on the graphs.
* [graphs.pl](graphs.pl) - Perl code that generates the graphs and tables. It will need to be re-run if the graph data are updated.
* [primaries2lad.json](primaries2lad.json) - how Primary sub-stations split between Local Authority Districts. The split was calculated using the proportion of customers attached to a Primary were within different Local Authority Districts.

## Sub-directories

### [graphs/](graphs/)

The graphs directory contains CSV files used to generate the graphs for `graph.html`. The [index.json](graphs/index.json) file defines each of the graphs that will be made by running `perl graph.pl`. Each one is of the form:

```
{
"csv":"Total number of EVs (#).csv",
"svg":"graph-ev.svg",
"table":"graph-ev.html",
"yaxis-label": "Number",
"yaxis-max": 100,
"yscale": 100,
"left": 120
}
```

where `csv` is the CSV file in the [graphs/](graphs/) directory to use, `svg` is the file name for the resulting SVG graphic, `table` is the resulting HTML fragment for the table, `yaxis-label` is the y-axis label, `left` is the left placement (in pixels) of the y-axis, `yaxis-max` is the maximum value for the y-axis (useful for limiting the auto-range), and `yscale` is a factor by which to scale the y-axis values (particularly useful for getting to percentages from 0-1 range numbers).

### [lib/](lib/)

This directory contains Perl modules for use by the `graphs.pl` code.

### [maps/](maps/)

The maps directory contains GeoJSON files that are needed for the visualisation. These include:

* [LAD2019-npg.geojson](maps/LAD2019-npg.geojson) - the Local Authority boundaries (2019)
* [primaries-unique-all.geojson](maps/primaries-unique-all.geojson) - the geography of the Primary sub-stations (based on 2019)

### [scenarios/](scenarios/)

The [scenarios/index.json](scenarios/index.json) JSON file describes the scenarios and gives links to the relevant data files for each parameter within each scenario.

The `parameters` are defined in [scenarios/config.json](scenarios/config.json).

26 changes: 26 additions & 0 deletions 2024-DFES/data/colours.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Domestic,#F1060E
I & C,#6DC2C7
Heat pumps - domestic,#2D137F
Heat pumps – I & C,#D6D2D1
EV,#45D526
Heating oil,#420A0C
Natural gas,#B8BFF9
Hydrogen,#0279FA
Bioenergy,#019303
Biofuel,#019303
Bio-fuel,#019303
Bio-energy,#019303
Petrol,#FFC300
Petroleum,#FFC300
Solid fuel,#505050
Diesel,#846F3F
Fuel Oil,#846F3F
Wind,#2780E7
Large solar,#F6F005
Domestic solar,#F65E05
Total emissions,#000000
Other,#80604E
Electric HGVs,#FF9966
Electric Buses,#466228
Electrolysers,#4BACC6
Large industry Fuel Switching,#808080
178 changes: 178 additions & 0 deletions 2024-DFES/data/graphs.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
#!/usr/bin/perl

# Get directory
my $dir;
BEGIN {
$dir = $0;
$dir =~ s/[^\/]*$//g;
if(!$dir){ $dir = "./"; }
$lib = $dir."lib/";
}
use lib $lib;
use utf8;
use warnings;
use strict;
use Data::Dumper;
use POSIX qw(strftime);
use JSON::XS;
use ODILeeds::NPG;

# Define input files
my $file_scenario = $dir."scenarios/index.json";
my $file_colours = $dir."colours.csv";
my $file_index = $dir."graphs/index.json";

# Define output file
my $file_html = $dir."../graphs.html";



# Define variables
my (@lines,%scenarios,@cols,$line,$scenario,@graphs,$html,$i,$graph,$svg,@sections,$section,$s,$str,$fig,$table);

# Get the scenario config
msg("Reading scenarios from <cyan>$file_scenario<none>\n");
open(FILE,$file_scenario);
@lines = <FILE>;
close(FILE);
%scenarios = %{JSON::XS->new->utf8->decode(join("\n",@lines))};
foreach $scenario (keys(%scenarios)){
msg("\t$scenario: $scenarios{$scenario}{'color'} / $scenarios{$scenario}{'css'}\n");
}

# Load in the extra colour definitions
msg("Reading colours from <cyan>$file_colours<none>\n");
open(FILE,$file_colours);
@lines = <FILE>;
close(FILE);
foreach $line (@lines){
$line =~ s/[\n\r]//g;
(@cols) = split(/,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/,$line);
if($cols[0]){
$scenarios{$cols[0]} = ();
$scenarios{$cols[0]}{'color'} = $cols[1];
}
}



if(-e $file_index){
msg("Read in graph definitions from <cyan>$file_index<none>\n");
# Get the graph config
open(FILE,$file_index);
@lines = <FILE>;
close(FILE);
@sections = @{JSON::XS->new->utf8->decode(join("\n",@lines))};

# Create the SVG output
$graph = ODILeeds::NPG->new();
$graph->setScenarios(%scenarios);
$html = "";


$fig = 1;

for($s = 0; $s < @sections; $s++){
msg("Section: <green>".($sections[$s]->{'title'}||"")."<none>\n");

$html .= "<h2>".($sections[$s]->{'title'}||"")."</h2>\n";
if($sections[$s]->{'intro'}){
$html .= ($sections[$s]->{'intro'}||"")."\n";
}
@graphs = @{$sections[$s]->{'graphs'}};
for($i = 0; $i < (@graphs); $i++,$fig++){
msg("\tFigure <yellow>$fig<none>: <cyan>".$dir."graphs/$graphs[$i]{'csv'}<none>\n");
$graph->load($dir.'graphs/'.$graphs[$i]{'csv'})->process();

# If we have a y-axis scaling we scale the values
if($graphs[$i]{'yscale'}){
$graph->scaleY($graphs[$i]{'yscale'});
}
$table = $graph->table(());

# Output the SVG
$svg = $graph->draw(('yaxis-label'=>$graphs[$i]{'yaxis-label'},'yscale'=>$graphs[$i]{'yscale'},'yaxis-max'=>$graphs[$i]{'yaxis-max'},'width'=>'640','xaxis-max'=>2051,'xaxis-line'=>1,'stroke'=>3,'strokehover'=>5,'point'=>4,'pointhover'=>6,'line'=>2,'yaxis-format'=>"commify",'yaxis-labels-baseline'=>'middle','xaxis-ticks'=>1,'left'=>$graphs[$i]{'left'},'tooltip'=>$graphs[$i]{'tooltip'}));
open(FILE,'>',$dir.'graphs/'.$graphs[$i]{'svg'});
print FILE $svg;
close(FILE);

# Set whitespace for HTML
$svg =~ s/\n/\n\t\t\t\t\t/g;
$table =~ s/\n/\n\t\t\t\t/g;

$html .= "\t\t\t<figure>\n";
$html .= "\t\t\t\t<figcaption><strong>Figure ".($fig).":</strong> $graphs[$i]{'title'}</figcaption>\n";
$html .= "\t\t\t\t<div class=\"table-holder\">\n";
$html .= "\t\t\t\t".$table;
$html .= "</div>\n";
$html .= "\t\t\t\t<div class=\"oi-viz oi-chart oi-chart-line\">\n";
$html .= "\t\t\t\t\t<a id=\"pre-fig-$fig\" href=\"#post-fig-$fig\" class=\"skip-link button\">Skip chart</a>\n";
$html .= "\t\t\t\t\t$svg\n";
$html .= "\t\t\t\t\t<a id=\"post-fig-$fig\" href=\"#pre-fig-$fig\" class=\"skip-link skip-link-bottom button\">Go to start of chart</a>\n";
$html .= "\t\t\t\t</div>\n";
$html .= "\t\t\t\t<div class=\"download\">\n";
$html .= "\t\t\t\t\t<a href=\"data/graphs/$graphs[$i]{'svg'}\"><img src=\"resources/download.svg\" alt=\"download\" title=\"Download graph from Figure ".($i+1)."\" /> SVG</a>\n";
$html .= "\t\t\t\t\t<a href=\"data/graphs/$graphs[$i]{'csv'}\"><img src=\"resources/download.svg\" alt=\"download\" title=\"Download data from Figure ".($i+1)."\" /> CSV</a>\n";
$html .= "\t\t\t\t</div>\n";
$html .= "\t\t\t</figure>\n\n";

}
}

open(FILE,$file_html);
@lines = <FILE>;
close(FILE);
$str = join("",@lines);
$str =~ s/(<!-- START GRAPHS -->)(.*)(<!-- END GRAPHS -->)/$1$html$3/s;

msg("Save result in <cyan>$file_html<none>\n");
open(FILE,">",$file_html);
print FILE $str;
close(FILE);

}else{
error("Unable to read graph definitions from <cyan>$file_index<none>\n");
}




#####################
# Subroutines

sub msg {
my $str = $_[0];
my $dest = $_[1]||"STDOUT";

my %colours = (
'black'=>"\033[0;30m",
'red'=>"\033[0;31m",
'green'=>"\033[0;32m",
'yellow'=>"\033[0;33m",
'blue'=>"\033[0;34m",
'magenta'=>"\033[0;35m",
'cyan'=>"\033[0;36m",
'white'=>"\033[0;37m",
'none'=>"\033[0m"
);
foreach my $c (keys(%colours)){ $str =~ s/\< ?$c ?\>/$colours{$c}/g; }
if($dest eq "STDERR"){
print STDERR $str;
}else{
print STDOUT $str;
}
}

sub error {
my $str = $_[0];
$str =~ s/(^[\t\s]*)/$1<red>ERROR:<none> /;
msg($str,"STDERR");
}

sub warning {
my $str = $_[0];
$str =~ s/(^[\t\s]*)/$1<yellow>WARNING:<none> /;
msg($str,"STDERR");
}


2 changes: 2 additions & 0 deletions 2024-DFES/data/graphs/AnnualCarbonEmissions_MtCO2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Scenario,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050
NPg Planning scenario,34.39444922,33.12113949,32.3219204,30.88868177,28.33214507,26.18467277,24.18075712,22.29941961,20.22364966,18.33698608,16.24639693,14.35157228,12.55832502,10.89264661,9.582072095,8.367612352,7.254486171,6.191408758,5.173389698,4.108110367,3.279335993,2.579018768,1.995023632,1.448057442,1.049046159,0.654529489,0.380736615,0.285127765,0.219863684
6 changes: 6 additions & 0 deletions 2024-DFES/data/graphs/AnnualNetworkEnergyConsumption_TWh.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Scenario,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050
Electric Engagement,34.390,35.090,35.796,36.377,37.190,38.212,39.328,40.650,41.819,42.991,44.133,45.240,46.909,49.210,51.308,53.282,55.106,56.845,58.224,59.448,60.613,61.749,62.854,63.838,64.747,65.600,66.431,67.109
Hydrogen Evolution,34.383,35.107,35.852,36.438,37.183,38.100,39.117,40.372,41.480,42.598,43.711,44.838,46.547,48.812,50.929,52.952,54.847,56.676,58.311,59.828,61.253,62.566,63.738,64.699,65.576,66.422,67.176,67.791
Holistic Transition,34.390,35.085,35.786,36.361,37.167,38.182,39.290,40.605,41.768,42.934,44.071,45.173,46.821,49.051,51.077,52.976,54.724,56.386,57.553,58.578,59.555,60.511,61.466,62.326,63.102,63.836,64.544,65.120
NPg Reference Scenario,34.390,35.150,36.033,36.894,37.963,39.082,40.190,41.630,42.917,44.150,45.329,46.463,48.084,50.363,52.422,54.341,56.084,57.732,59.130,60.338,61.472,62.577,63.654,64.627,65.544,66.411,67.255,67.948
Counterfactual,34.381,35.108,35.781,36.303,37.011,37.809,38.657,39.785,40.802,41.849,42.895,43.960,45.238,46.325,47.418,48.514,49.582,50.666,51.610,52.471,53.268,53.974,54.592,55.083,55.515,55.904,56.255,56.564
7 changes: 7 additions & 0 deletions 2024-DFES/data/graphs/AnnualPeakDemand_GW.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Scenario ,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050
Electric Engagement,6.312,6.595,6.849,7.129,7.582,7.837,8.043,8.338,8.536,8.732,8.918,9.099,9.510,10.016,10.483,10.928,11.346,11.770,12.098,12.391,12.674,12.955,13.258,13.506,13.735,13.951,14.163,14.332
Hydrogen Evolution,6.345,6.643,6.921,7.218,7.670,7.915,8.115,8.414,8.620,8.823,9.021,9.217,9.676,10.302,10.888,11.450,11.984,12.521,13.000,13.456,13.893,14.304,14.692,14.984,15.249,15.509,15.734,15.901
Holistic Transition,6.312,6.594,6.846,7.125,7.575,7.828,8.032,8.325,8.522,8.715,8.899,9.076,9.481,9.962,10.402,10.820,11.210,11.605,11.876,12.116,12.349,12.581,12.841,13.053,13.244,13.424,13.597,13.736
Counterfactual,6.352,6.652,6.909,7.189,7.631,7.847,8.013,8.298,8.499,8.703,8.903,9.104,9.441,9.646,9.847,10.046,10.239,10.457,10.630,10.789,10.943,11.081,11.223,11.314,11.397,11.475,11.547,11.612
NPg Reference Scenario,6.312,6.610,6.905,7.249,7.761,8.040,8.245,8.568,8.793,9.001,9.194,9.378,9.782,10.289,10.750,11.184,11.583,11.986,12.314,12.599,12.870,13.140,13.432,13.675,13.905,14.124,14.338,14.510
NPg Reference Scenario (No ToUT),6.351,6.676,7.009,7.404,7.969,8.304,8.567,8.952,9.236,9.495,9.736,9.964,10.415,10.969,11.471,11.943,12.376,12.809,13.162,13.469,13.760,14.046,14.352,14.606,14.845,15.071,15.292,15.469
6 changes: 6 additions & 0 deletions 2024-DFES/data/graphs/BatteryStorageCapacityInstalled_GW.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Scenario,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050
Electric Engagement,0.371,0.409,0.445,0.485,0.650,0.821,0.994,1.215,1.411,1.760,1.885,1.992,2.022,2.053,2.088,2.126,2.167,2.211,2.259,2.310,2.365,2.422,2.482,2.545,2.611,2.681,2.754,2.831
Hydrogen Evolution,0.371,0.400,0.430,0.462,0.675,0.841,0.965,1.081,1.178,1.475,1.581,1.588,1.596,1.603,1.612,1.621,1.631,1.642,1.654,1.667,1.681,1.696,1.711,1.728,1.744,1.762,1.780,1.799
Holistic Transition,0.371,0.409,0.445,0.484,0.680,0.862,1.015,1.171,1.544,1.694,1.977,2.009,2.043,2.079,2.120,2.164,2.212,2.363,2.419,2.479,2.542,2.609,2.679,2.753,2.830,2.911,2.997,3.087
NPg Reference Scenario,0.371,0.411,0.449,0.489,0.661,0.840,1.029,1.264,1.481,2.040,2.199,2.332,2.347,2.364,2.380,2.408,2.447,2.501,2.549,2.462,2.506,2.575,2.638,2.702,2.767,2.836,2.911,2.991
Counterfactual,0.371,0.400,0.429,0.460,0.660,0.762,0.928,1.095,1.098,1.237,1.423,1.426,1.507,1.511,1.515,1.519,1.523,1.528,1.534,1.620,1.626,1.633,1.641,1.648,1.656,1.665,1.674,1.683
2 changes: 2 additions & 0 deletions 2024-DFES/data/graphs/CumulativeCarbonEmissions_MtCO2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Scenario,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050
NPg Planning Scenario,104.4599061,137.5810456,169.902966,200.7916478,229.1237929,255.3084656,279.4892228,301.7886424,322.012292,340.3492781,356.595675,370.9472473,383.5055723,394.3982189,403.980291,412.3479034,419.6023896,425.7937983,430.967188,435.0752984,438.3546344,440.9336532,442.9286768,444.3767342,445.4257804,446.0803099,446.4610465,446.7461743,446.9660379
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Scenario,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050
NPg Reference Scenario,0.03,0.05,0.09,0.13,0.19,0.25,0.31,0.38,0.45,0.52,0.58,0.64,0.69,0.74,0.78,0.82,0.85,0.88,0.91,0.93,0.94,0.96,0.97,0.98,0.98,0.99,0.99,0.99
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Additional Energy consumption breakdown,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050
Electrolysers,0.000,0.001,0.079,0.191,0.224,0.298,0.593,0.906,1.291,1.897,2.720,3.713,5.103,5.828,8.596,8.921,9.369,9.844,10.757,12.740,13.967,14.915,15.498,16.257,17.012,17.251,17.230,16.957
Large industry Fuel Switching,0.183,0.244,0.305,0.406,0.506,0.607,0.708,0.809,0.942,1.075,1.208,1.341,1.474,1.653,1.833,2.012,2.191,2.371,2.739,3.107,3.475,3.843,4.211,4.817,5.423,6.029,6.635,7.241
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Demand type,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050
Electrolysers,0,0,9,22,26,34,68,103,147,217,310,424,583,665,981,1018,1070,1124,1228,1454,1594,1703,1769,1856,1942,1969,1967,1936
Large industry Fuel Switching,21,28,35,46,58,69,81,92,108,123,138,153,168,189,209,230,250,271,313,355,397,439,481,550,619,688,757,827
Loading

0 comments on commit b5ce871

Please sign in to comment.