-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
192 changed files
with
73,187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Northern Powergrid Future Energy Scenarios 2021 | ||
|
||
**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 2021 | ||
Four of the scenarios presented are aligned with Nationalgrid|ESO's [Future Energy Scenarios](https://www.nationalgrideso.com/future-energy/future-energy-scenarios): | ||
|
||
* Steady progression | ||
* System transformation | ||
* Customer transformation | ||
* Leading the way | ||
|
||
### Geographies | ||
|
||
For this visualisation [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. We chose to use [Output Areas](https://www.ons.gov.uk/census/2001censusandearlier/dataandproducts/outputgeography/outputareas) (2011) 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. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/usr/bin/perl | ||
|
||
# Get directory | ||
my $dir; | ||
BEGIN { | ||
$dir = $0; | ||
$dir =~ s/[^\/]*$//g; | ||
if(!$dir){ $dir = "./"; } | ||
$lib = $dir."lib/"; | ||
} | ||
use lib $lib; | ||
use Data::Dumper; | ||
use POSIX qw(strftime); | ||
use JSON::XS; | ||
use ODILeeds::NPG; | ||
|
||
# Get the scenario config | ||
open(FILE,$dir."scenarios/index.json"); | ||
@lines = <FILE>; | ||
close(FILE); | ||
%scenarios = %{JSON::XS->new->utf8->decode(join("\n",@lines))}; | ||
foreach $scenario (keys(%scenarios)){ | ||
print "$scenario - $scenarios{$scenario}{'color'} - $scenarios{$scenario}{'css'}\n"; | ||
} | ||
|
||
# Load in the extra colour definitions | ||
open(FILE,$dir."colours.csv"); | ||
@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]; | ||
} | ||
} | ||
|
||
$indexfile = $dir."graphs/index.json"; | ||
|
||
if(-e $indexfile){ | ||
# Get the graph config | ||
open(FILE,$indexfile); | ||
@lines = <FILE>; | ||
close(FILE); | ||
@graphs = @{JSON::XS->new->utf8->decode(join("\n",@lines))}; | ||
|
||
|
||
|
||
# Create the SVG output | ||
$graph = ODILeeds::NPG->new(); | ||
$graph->setScenarios(%scenarios); | ||
|
||
$html = ""; | ||
for($i = 0; $i < (@graphs); $i++){ | ||
print "Processing ".$dir."graphs/$graphs[$i]{'csv'}\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'}); | ||
} | ||
|
||
# Output the SVG | ||
open(FILE,'>',$dir.'graphs/'.$graphs[$i]{'svg'}); | ||
print FILE $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'})); | ||
close(FILE); | ||
|
||
# Output the HTML table | ||
open(FILE,'>',$dir.'graphs/'.$graphs[$i]{'table'}); | ||
print FILE $graph->table(()); | ||
close(FILE); | ||
|
||
$html .= "\t\t\t<figure class=\"jekyll-parse\">\n"; | ||
$html .= "\t\t\t\t<figcaption><strong>Figure ".($i+1).":</strong> $graphs[$i]{'title'}</figcaption>\n"; | ||
$html .= "\t\t\t\t<div class=\"table-holder\">{% include_relative data/graphs/$graphs[$i]{'table'} %}</div>\n"; | ||
$html .= "\t\t\t\t{% include_relative data/graphs/$graphs[$i]{'svg'} %}\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,">",$dir."graphs.txt"); | ||
print FILE $html; | ||
close(FILE); | ||
} | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.