Load Location Data Repositories¶
This notebook demonstrates how OptiWindNet can load all osm.pbf and .yaml files from a directory into a namedtuple of networkx graphs, which can be used to initialize a WindFarmNetwork() instance.
Import required modules¶
To use this functionality we need load_repository() as well as WindFarmNetwork.
[1]:
from optiwindnet.api import WindFarmNetwork, load_repository
[2]:
# Display figures as SVG in Jupyter notebooks
%config InlineBackend.figure_formats = ['svg']
Load a repository¶
load_repository() reads the .osm.pbf and .yaml locations distributed with OptiWindNet into a namedtuple of networkx graphs containing location data.
Note: if no argument is passed to the function, it loads the default locations included in the OptiWindNet repository. However, the user can also provide a custom repository containing
.osm.pbfand.yamlfiles by:locations = load_repository(path='path to the repository folder')
[3]:
locations = load_repository()
[4]:
len(locations), ', '.join(locations._fields)
[4]:
(91,
'anholt, borkum, borkum2, borssele, butendiek, cazzaro_2022, cazzaro_2022G140, cazzaro_2022G210, dantysk, doggerA, dudgeon, anglia, gode, gabbin, gwynt, horns, horns2, horns3, hornsea, hornsea2w, london, morayeast, moraywest, ormonde, race, rampion, rødsand2, sofia, taylor_2023, thanet, triton, walney1, walney2, walneyext, sands, yi_2019, albatros, amrumbank, arkona, baltic2, eagle, bard, beatrice, belwind, nanpeng, rudongdemo, bucht, fecamp, galloper, gemini1, gemini2, glotech1, hohesee, kustzuid, humber, kaskasi, kfA, kfB, bodhi, lillgrund, lincs, luchterduinen, meerwind, merkur, mermaid, neart, nordsee, nordseeost, norther, northwind, nysted, amalia, rental, riffgat, robin, rudongH10, rudongH6, rudongH8, brieuc, nazaire, sandbank, seagreen, shengsi2, sheringham, binhainorthH2, triborkum, vejamate, vineyard, rough, wikinger, jiaxing1')
Each location is loaded as a networkx graph containing location data.
[5]:
type(locations.seagreen)
[5]:
networkx.classes.graph.Graph
Use loaded locations¶
Initialize an instance of WindFarmNetwork with one of the locations (e.g. seagreen).
[6]:
wfn = WindFarmNetwork(L=locations.seagreen, cables=[(2, 1500.0), (5, 1800.0)])
Plot location¶
Note: We could use
wfn.plot_location()for plotting the location. For more details look into the notebook about plotting
[7]:
wfn
[7]:
List locations in the loaded repository¶
Print (for all available locations):
nameR: number of Roots (Substations)T: number of Terminals (Turbines)
[8]:
for L in locations:
print(L.graph['handle'], ':', L.graph['name'], '->',
L.graph['R'], ',', L.graph['T'])
anholt : Anholt -> 1 , 111
borkum : Borkum Riffgrund 1 -> 1 , 78
borkum2 : Borkum Riffgrund 2 -> 1 , 52
borssele : Borssele -> 2 , 173
butendiek : Butendiek -> 1 , 80
cazzaro_2022 : Cazzaro-2022 -> 1 , 50
cazzaro_2022G140 : Cazzaro-2022G-140 -> 3 , 140
cazzaro_2022G210 : Cazzaro-2022G-210 -> 3 , 210
dantysk : DanTysk -> 1 , 80
doggerA : Dogger Bank A -> 1 , 95
dudgeon : Dudgeon -> 1 , 67
anglia : East Anglia ONE -> 1 , 102
gode : Gode Wind 1 -> 1 , 55
gabbin : Greater Gabbard Inner -> 1 , 102
gwynt : Gwynt y Mor -> 2 , 160
horns : Horns Rev 1 -> 1 , 80
horns2 : Horns Rev 2 -> 1 , 91
horns3 : Horns Rev 3 -> 1 , 49
hornsea : Hornsea One -> 3 , 174
hornsea2w : Hornsea Two West -> 1 , 110
london : London Array -> 2 , 175
morayeast : Moray East -> 3 , 100
moraywest : Moray West -> 2 , 60
ormonde : Ormonde -> 1 , 30
race : Race Bank -> 2 , 91
rampion : Rampion -> 1 , 116
rødsand2 : Rødsand 2 -> 1 , 90
sofia : Sofia -> 1 , 100
taylor_2023 : Taylor-2023 -> 2 , 122
thanet : Thanet -> 1 , 100
triton : Triton Knoll -> 2 , 90
walney1 : Walney 1 -> 1 , 51
walney2 : Walney 2 -> 1 , 51
walneyext : Walney Extension -> 2 , 87
sands : West of Duddon Sands -> 1 , 108
yi_2019 : Yi-2019 -> 2 , 119
albatros : Albatros -> 1 , 16
amrumbank : Amrumbank West -> 1 , 80
arkona : Arkona -> 1 , 60
baltic2 : Baltic 2 -> 1 , 80
eagle : Baltic Eagle -> 1 , 50
bard : BARD Offshore 1 -> 1 , 80
beatrice : Beatrice -> 2 , 84
belwind : Belwind -> 1 , 55
nanpeng : CECEP Yangjiang Nanpeng Island -> 1 , 55
rudongdemo : CGN Rudong Demonstration -> 1 , 38
bucht : Deutsche Bucht -> 1 , 31
fecamp : Fecamp -> 1 , 71
galloper : Galloper Inner -> 1 , 38
gemini1 : Gemini 1 -> 1 , 75
gemini2 : Gemini 2 -> 1 , 75
glotech1 : Global Tech 1 -> 1 , 80
hohesee : Hohe See -> 1 , 71
kustzuid : Hollandse Kust Zuid -> 2 , 139
humber : Humber Gateway -> 1 , 73
kaskasi : Kaskasi -> 1 , 38
kfA : Kriegers Flak A -> 1 , 24
kfB : Kriegers Flak B -> 1 , 48
bodhi : Laoting Bodhi Island -> 1 , 75
lillgrund : Lillgrund -> 1 , 48
lincs : Lincs -> 1 , 75
luchterduinen : Luchterduinen -> 1 , 43
meerwind : Meerwind -> 1 , 80
merkur : Merkur -> 1 , 66
mermaid : Mermaid -> 1 , 27
neart : Neart na Gaoithe -> 2 , 54
nordsee : Nordsee One -> 1 , 54
nordseeost : Nordsee Ost -> 1 , 48
norther : Norther -> 1 , 44
northwind : Northwind -> 1 , 72
nysted : Nysted -> 1 , 72
amalia : Princess Amalia -> 1 , 60
rental : Rentel -> 1 , 42
riffgat : Riffgat -> 1 , 30
robin : Robin Rigg -> 1 , 60
rudongH10 : Rudong H10 -> 1 , 100
rudongH6 : Rudong H6 -> 1 , 100
rudongH8 : Rudong H8 -> 1 , 65
brieuc : Saint-Brieuc -> 1 , 62
nazaire : Saint-Nazaire -> 1 , 80
sandbank : Sandbank -> 1 , 72
seagreen : Seagreen -> 1 , 114
shengsi2 : Shengsi 2 -> 1 , 63
sheringham : Sheringham Shoal -> 2 , 88
binhainorthH2 : SPIC Binhai North H2 -> 1 , 100
triborkum : Trianel Windpark Borkum -> 1 , 72
vejamate : Veja Mate -> 1 , 67
vineyard : Vineyard Wind 1 -> 1 , 62
rough : Westermost Rough -> 1 , 35
wikinger : Wikinger -> 1 , 70
jiaxing1 : Zhejiang Jiaxing 1 -> 1 , 74
Any of the locations in this list can be directly passed to WindFarmNetwork instance as L graph, e.g.:
wfn = WindFarmNetwork(L=locations.seagreen, cables=7)