@binocularity May 2023/June2023/September2023​
​​
​In October 2024 NGESO changed to NESO we updated the data feeds.​
​​
​The fuel data used here has been cleaned and visualized and originally comes from NGESO:​
​​
​https://data.nationalgrideso.com/carbon-intensity1/historic-generation-mix​
​​
​Find the cleaned data at the embedded URL links below to download your own copy.
In[]:=
(*Setupfoldersandintialisationcode*)​​folder=NotebookDirectory[];​​SetDirectory[folder];​​​​​​(*Pre-cleaneddata*)​​dayInYTD=CloudGet["https://www.wolframcloud.com/obj/binocularity/Published/dayInYTD"];​​dataD=CloudGet["https://www.wolframcloud.com/obj/binocularity/Published/dataD"];​​fuelColoursOrdered=CloudGet["https://www.wolframcloud.com/obj/binocularity/Published/fuelColoursOrdered"];​​datesLBlanks=CloudGet["https://www.wolframcloud.com/obj/binocularity/Published/datesLBlanks"];​​stringDate=CloudGet["https://www.wolframcloud.com/obj/binocularity/Published/stringDate"];​​fuelDSout=CloudGet["https://www.wolframcloud.com/obj/binocularity/Published/fuelDSout"];​​fuelPcDSout=CloudGet["https://www.wolframcloud.com/obj/binocularity/Published/fuelPcDSout"];​​​​(*FuelcolourschosentomatchNGESOpublications*)​​fuelColours=Association[{​​"GAS"RGBColor[Evaluate[{247,99,43}/255]],​​"COAL"RGBColor[Evaluate[{1,1,1}/255]],​​"NUCLEAR"RGBColor[Evaluate[{108,44,145}/255]],​​"WIND"RGBColor[Evaluate[{92,200,246}/255]],​​"HYDRO"RGBColor[Evaluate[{0,121,192}/255]],​​"IMPORTS"RGBColor[Evaluate[{194,0,119}/255]],​​"BIOMASS"RGBColor[Evaluate[{194,204,44}/255]],​​"OTHER"RGBColor[Evaluate[{255,205,243}/255]],​​"SOLAR"RGBColor[Evaluate[{253,231,1}/255]],​​"STORAGE"RGBColor[Evaluate[{255,255,255}/255]]​​}];​​styleColours=fuelColours[[#]]&/@Keys[fuelColoursOrdered];​​swatch=Reverse[fuelColoursOrdered];​​legend=SwatchLegend[Values[swatch],Keys[swatch]];​​​​dataReorder=dataD[All,Keys[fuelColoursOrdered]];​​​​Print[" Cleaned data dowloaded from the Cloud"]​​
Cleaned data dowloaded from the Cloud
In[]:=
chartTitle=StringJoin[{"Electricity supply by fuel type, week ending: ",stringDate,", UK (E,W,S)."}];​​glBool=2;​​glOptions={None,{0,48,96,144,192,240,288,336}};​​id=glOptions[[2]]+1;​​id=id[[;;-2]];​​yTicks={20,40,50,60,80,100};​​newDates=datesLBlanks[[id]];​​newDates=Rotate[#,Pi/4]&/@newDates;​​xTicks=Partition[Riffle[id,newDates],2];​​interactive=​​Overlay[{​​Show[​​BarChart[dataReorder,BarSpacingAutomatic,ChartLayout"Stacked",​​ChartStyle{EdgeForm[],styleColours},​​AxesFalse,​​Method{"GridLinesInFront"True},​​GridLinesStyleDirective[Black,Medium,Thick,Dashing[Small]],​​GridLines{glOptions[[glBool]],None},​​ImageSize{Automatic,560},ImagePadding{{50,90},{60,60}},BackgroundRGBColor[{0.5,0.5,0.5}],​​Epilog{{},​​Text[Style[chartTitle,18,Bold,White],{155,110}]}],​​FrameStyleDirective[White,12],​​Frame{{True,None},{True,None}},​​FrameTicks{{yTicks,None},{xTicks,None}}],​​legend},Alignment{Right,Center}]
Out[]=
SOLAR
HYDRO
BIOMASS
STORAGE
WIND
COAL
GAS
IMPORTS
OTHER
NUCLEAR
In[]:=
formattedDS=Dataset[fuelDSout,Background(If[#≤10,LightGreen,If[#≥(dayInYTD-10),LightRed,White]]&),AlignmentRight,HeaderStyle{"Bold","Code"},ItemStyle{"SubItem"}]
Out[]=
Rank in YTD / 30
Sat 24 Jan 2026
Sun 25 Jan 2026
Mon 26 Jan 2026
Tue 27 Jan 2026
Wed 28 Jan 2026
Thu 29 Jan 2026
Fri 30 Jan 2026
NUCLEAR
26
19
23
24
7
12
10
OTHER
18
16
6
14
4
5
11
IMPORTS
16
19
23
21
17
28
13
GAS
30
21
8
22
5
6
25
COAL
unused
unused
unused
unused
unused
unused
unused
WIND
1
13
19
4
28
18
7
STORAGE
26
15
4
24
3
10
29
BIOMASS
3
2
18
25
15
17
11
HYDRO
5
12
11
17
1
13
28
SOLAR
8
20
24
21
1
19
14
In[]:=
​​formattedPcDS=Dataset[fuelPcDSout,HeaderStyle->{"Bold","Code"},ItemStyle->{"SubItem"},Alignment->Right,ItemDisplayFunction->(NumberForm[#,{3,1}]&)]
Out[]=
Percentage daily
Sat 24 Jan 2026
Sun 25 Jan 2026
Mon 26 Jan 2026
Tue 27 Jan 2026
Wed 28 Jan 2026
Thu 29 Jan 2026
Fri 30 Jan 2026
NUCLEAR
8.9
9.5
9.1
9.0
10.8
10.2
10.3
OTHER
1.4
1.4
2.0
1.6
2.2
2.1
1.7
IMPORTS
10.6
9.1
7.2
8.6
9.4
4.6
12.2
GAS
11.3
23.0
41.5
21.7
45.2
42.2
16.7
COAL
0
0
0
0
0.0
0
0
WIND
55.5
45.7
31.1
51.1
19.1
31.7
49.3
STORAGE
0.1
0.4
0.7
0.2
0.9
0.5
0.0
BIOMASS
8.1
8.7
6.5
5.8
7.0
6.5
7.3
HYDRO
1.5
1.4
1.4
1.3
1.8
1.3
0.9
SOLAR
2.5
0.8
0.6
0.8
3.6
0.9
1.5