Quick Overview
Here is a quick overview of PyWAsP. To begin with, lets import pywasp
, windkit
. We will use pathlib.Path
to point to the data location.
In [1]: from pathlib import Path
In [2]: import pywasp as pw
In [3]: import windkit as wk
In [4]: path = Path("../modules/examples/tutorial_1/data")
Read in a observed wind climate
You can use windkit
to open a WAsP .omwc
file, which is a binned observed wind climate file, and reproject it to
UTM32 coordinates
In [5]: bwc = wk.read_bwc(path / "SerraSantaLuzia.omwc", crs="EPSG:4326")
In [6]: bwc = wk.spatial.reproject(bwc, to_crs="EPSG:32629")
In [7]: print(bwc)
<xarray.Dataset>
Dimensions: (point: 1, sector: 12, wsbin: 32)
Coordinates:
height (point) float64 25.3
crs int8 0
* wsbin (wsbin) float64 0.5 1.5 2.5 3.5 4.5 ... 28.5 29.5 30.5 31.5
wsceil (wsbin) float64 1.0 2.0 3.0 4.0 5.0 ... 29.0 30.0 31.0 32.0
wsfloor (wsbin) float64 0.0 1.0 2.0 3.0 4.0 ... 28.0 29.0 30.0 31.0
* sector (sector) float64 0.0 30.0 60.0 90.0 ... 270.0 300.0 330.0
sector_ceil (sector) float64 15.0 45.0 75.0 105.0 ... 285.0 315.0 345.0
sector_floor (sector) float64 345.0 15.0 45.0 75.0 ... 255.0 285.0 315.0
west_east (point) float64 5.147e+05
south_north (point) float64 4.621e+06
Dimensions without coordinates: point
Data variables:
wdfreq (sector, point) float64 0.05314 0.03321 ... 0.1148 0.0707
wsfreq (wsbin, sector, point) float64 0.02601 0.04219 ... 0.0 0.0
Attributes:
Conventions: CF-1.8
history: 2024-06-11T13:35:32+00:00:\twindkit==0.8.0\tcreate_data...
wasp_header: SerraSantaluzia
Package name: windkit
Package version: 0.8.0
Creation date: 2024-06-11T13:35:32+00:00
Object type: Binned Wind Climate
author: DTU CI Config
author_email: pywasp@dtu.dk
institution: DTU Wind
Read in topography data
Secondly, let’s also read in some elevation and landcover data and combine it into a pywasp.wasp.TopographyMap
In [8]: elev_map = wk.read_vector_map(path / "SerraSantaLuzia.map", crs="EPSG:32629", map_type="elevation")
In [9]: lc_map, lc_tbl = wk.read_vector_map(path / "SerraSantaLuzia.map", crs="EPSG:32629", map_type="roughness")
In [10]: topo_map = pw.wasp.TopographyMap(elev_map, lc_map, lc_tbl)
Calculate Generalized Wind climate
A observed wind climate can be generalized with WAsP, using the pywasp.wasp.generalize
function
In [11]: gwc = pw.wasp.generalize(bwc, topo_map)
In [12]: print(gwc)
<xarray.Dataset>
Dimensions: (point: 1, sector: 12, gen_roughness: 5, gen_height: 5)
Coordinates:
height (point) float64 25.3
south_north (point) float64 4.621e+06
west_east (point) float64 5.147e+05
crs int8 0
* sector (sector) float64 0.0 30.0 60.0 90.0 ... 270.0 300.0 330.0
sector_ceil (sector) float64 15.0 45.0 75.0 105.0 ... 285.0 315.0 345.0
sector_floor (sector) float64 345.0 15.0 45.0 75.0 ... 255.0 285.0 315.0
* gen_roughness (gen_roughness) float64 0.0 0.03 0.1 0.4 1.5
* gen_height (gen_height) int64 10 25 50 100 250
Dimensions without coordinates: point
Data variables:
A (sector, gen_height, gen_roughness, point) float32 5.69 .....
k (sector, gen_height, gen_roughness, point) float32 1.717 ....
wdfreq (sector, gen_height, gen_roughness, point) float32 0.06491...
site_elev (point) float32 381.0
Attributes:
Conventions: CF-1.8
history: 2024-06-11T13:35:32+00:00:\twindkit==0.8.0\tcreate_data...
wasp_header: SerraSantaluzia
Package name: windkit
Package version: 0.8.0
Creation date: 2024-06-11T13:35:35+00:00
Object type: Geostrophic Wind Climate
author: DTU CI Config
author_email: pywasp@dtu.dk
institution: DTU Wind
title: Generalized wind climate
Downscale to wind turbine locations
The generalized wind climate can be used with the topography data to predict the wind climate at nearby locations, like the hub-height of planned wind turbines
In [13]: import pandas as pd
In [14]: wtg_locs = pd.read_csv(path / 'turbine_positions.csv')
In [15]: output_locs = wk.create_dataset(wtg_locs.Easting.values,
....: wtg_locs.Northing.values,
....: wtg_locs['Hub height'].values,
....: crs="EPSG:32629")
....:
In [16]: wwc = pw.wasp.downscale(gwc, topo_map, output_locs=output_locs, interp_method="nearest")
In [17]: print(wwc)
<xarray.Dataset>
Dimensions: (sector: 12, point: 15)
Coordinates:
* sector (sector) float64 0.0 30.0 60.0 90.0 ... 270.0 300.0 330.0
height (point) int64 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50
south_north (point) int64 4622313 4622199 4622336 ... 4624252 4624142
west_east (point) int64 513914 514161 514425 ... 515808 516060 516295
crs int8 0
sector_ceil (sector) float64 15.0 45.0 75.0 105.0 ... 285.0 315.0 345.0
sector_floor (sector) float64 345.0 15.0 45.0 75.0 ... 255.0 285.0 315.0
Dimensions without coordinates: point
Data variables:
A (sector, point) float32 7.428 7.399 7.054 ... 7.75 8.305
k (sector, point) float32 2.029 2.037 2.041 ... 2.127 2.123
wdfreq (sector, point) float32 0.06445 0.06485 ... 0.07584 0.0792
site_elev (point) float32 459.7 460.0 460.0 427.1 ... 520.0 520.0 520.0
air_density (point) float32 1.163 1.163 1.163 1.167 ... 1.156 1.156 1.156
wspd (point) float32 7.435 7.257 6.978 7.08 ... 7.548 7.818 8.102
power_density (point) float32 414.6 385.3 340.9 369.0 ... 426.1 481.9 532.1
Attributes:
Conventions: CF-1.8
history: 2024-06-11T13:35:35+00:00:\twindkit==0.8.0\t wk.create_...
title: WAsP site effects
Package name: windkit
Package version: 0.8.0
Creation date: 2024-06-11T13:35:36+00:00
Object type: Met fields
author: DTU CI Config
author_email: pywasp@dtu.dk
institution: DTU Wind
Estimate the gross AEP
The weibull wind climates predicted by WAsP can be used to estimate the Annual Energy Production in GWh for a specific turbine model
In [18]: wtg = wk.read_wtg(path / "Bonus_1_MW.wtg")
In [19]: gross_aep = pw.wasp.gross_aep(wwc, wtg)
In [20]: print(gross_aep)
<xarray.Dataset>
Dimensions: (point: 15)
Coordinates:
height (point) int64 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50
south_north (point) int64 4622313 4622199 4622336 ... 4624252 4624142
west_east (point) int64 513914 514161 514425 ... 515808 516060 516295
crs int8 0
Dimensions without coordinates: point
Data variables:
gross_AEP (point) float32 2.906 2.767 2.552 2.629 ... 2.996 3.189 3.407
Attributes:
Conventions: CF-1.8
history: 2024-06-11T13:35:35+00:00:\twindkit==0.8.0\t wk.create_...
title: WAsP site effects
Package name: windkit
Package version: 0.8.0
Creation date: 2024-06-11T13:35:36+00:00
Object type: Anual Energy Production
author: DTU CI Config
author_email: pywasp@dtu.dk
institution: DTU Wind
In the User Guide we go into more much greater detail with each component in PyWAsP.