WAsP#
WindKit provides I/O to many of the WAsP file formats.
WAsP Workspace#
WAsP workspaces store objects of a wasp session. WindKit can read WAsP workspaces using the windkit.Workspace class.
import windkit as wk
wwh = wk.Workspace.read_wwh("site.wwh")
print(wwh)
Printing the workspace lists every object it holds as a tree, with the integer ID each getter takes (turbine sites T3 to T14 left out here):
WAsP workspace site.wwh (format version 4.01.0006, CRS EPSG:32629)
ID Object Name
0 WAsP workspace ssl_default_12_10_0_30
1 WAsP project Project 1
2 Turbine site group Turbine cluster
3 Turbine site T1
4 Turbine site T2
...
17 Turbine site T15
18 Reference site Reference site for the turbine cluster
19 Terrain analysis (IBZ) Terrain analysis (IBZ) 1
20 Vector map Serra Santa Luzia
21 Vector map data layer Serra Santa Luzia
22 Vector map data layer Serra Santa Luzia
23 Generalised wind climate GWC
24 Met. station SerraSantaluzia
25 Observed wind climate SerraSantaLuzia
26 Wind turbine generator Bonus 1 MW
27 Reference site Reference site
Addressing objects#
A getter called without an ID reads the only object of its kind in the
workspace, which is all a single-project workspace needs. When there is more
than one candidate it raises and lists them, so the ID to pass is in the error
message. get_ids() finds the IDs of a kind of
object, and raises when the workspace holds none of them.
bwc = wwh.get_owc() # the only observed wind climate
gwc = wwh.get_gwc() # the only generalized wind climate
wtg = wwh.get_wtg() # the only wind turbine generator
aep = wwh.get_aep() # the only turbine site group
mast_id = wwh.get_ids("Met. station")[0]
wwc = wwh.get_wwc(mast_id)
Positions come from the workspace itself: a met station gives the position of
its observed and generalized wind climates. Their CRS is the one the vector
maps of the object’s WAsP project state or, for an object outside any project,
the one all vector maps of the workspace state. When the workspace states none,
give it with crs; a crs that differs from the stated one overrides it
with a warning.
turbines = wwh.get_turbines(crs=32719)
Inputs#
get_owc(),
get_wtg(),
get_turbines(),
get_elevation_map() and
get_roughness_map() return the inputs of the WAsP
session, as the WindKit datasets and geodataframes the rest of the library
works with. get_parameters() returns the WAsP
parameters of every object as a pandas.DataFrame, which is the way to
check what a session was configured with.
Results WAsP calculated#
The results stored in the workspace are WAsP’s own values as stored, parsed without rounding. Every getter takes a single site, and the site getters also take a turbine site group, which gives one point per turbine site:
observed_wwc = wwh.get_owc_weibull_fit() # WAsP's Weibull fit of the observations
gwc = wwh.get_gwc() # the GWC WAsP calculated from the observations
wwc = wwh.get_wwc(group_id) # predicted Weibull wind climate, A, k, wdfreq
effects = wwh.get_site_effects(group_id) # z0meso, speedups, turnings, dirrix, ...
aep = wwh.get_aep(group_id) # gross_aep and potential_aep in GWh/y
Each dataset carries a description attribute saying what it is, which
matters at a met station: get_wwc() there is WAsP’s
self-prediction from the generalized wind climate, while
get_owc_weibull_fit() is the fit of the
observations themselves.
The mesoscale climate#
WAsP 12.8 and newer store the mesoscale climate the generalization ran with.
get_mesoclimate() returns its sector-wise stability
and baroclinicity under the names PyWAsP uses, so it can be passed straight to
PyWAsP’s generalization, and
get_air_density_reference() returns the pressure,
temperature and humidity behind WAsP’s air density.
mesoclimate = wwh.get_mesoclimate()
print(mesoclimate.mean_temp_scale_land) # per sector
print(wwh.get_air_density_reference().surface_pressure)
Outdated results#
WAsP flags a calculation whose inputs changed after it ran. Reading results from such an object warns, since they may not match the rest of the workspace:
UserWarning: WAsP marked results as not up to date for object 2
('Turbine cluster'): Calculation4 in site.wwh. Recalculate them in WAsP and
save the workspace to read current results.
Recalculate in WAsP and save the workspace to read current results, or silence
the warning with
warnings.filterwarnings("ignore", message="WAsP marked results").
Anything the getters do not turn into a dataset is reachable through
get_member(), which returns the parsed data of one
object, such as the wake modelling settings of a turbine site group or the
omnidirectional gross AEP of a turbine site. See Workspace Format (.wwh) for
that low-level data and for the .wwh format itself.