Generalized Wind Climate (GWC)#
The generalized wind climate is a key part of the WAsP methodology. It represents the wind in a virtual world with no terrain and homogeneous roughness values. GWC contains Weibull parameters across additional dimensions for generalized heights and roughnesses.
A generalized wind climate tries to be representative of a larger area, while an observed or predicted wind climate is representative only of a specific location.
Data Structure#
GWC objects are xarray.Dataset with the following schema:
Dimensions: (gen_roughness, gen_height, sector, ...)
Variables:
A (gen_roughness, gen_height, sector, ...) - Weibull scale
k (gen_roughness, gen_height, sector, ...) - Weibull shape
wdfreq (gen_roughness, gen_height, sector, ...) - direction frequency
In addition to the core coordinates, GWC objects contain:
gen_height- generalized heights (meters above constant terrain)gen_roughness- homogeneous roughness lengths
Note
In classic WAsP, you were limited to exactly five of each parameter. In WindKit, you can use as many or as few as needed.
I/O#
Format |
Read |
Write |
Description |
|---|---|---|---|
|
yes |
yes |
WAsP Library format |
|
yes |
no |
WAsP Generalized Wind Climate |
|
yes |
via |
NetCDF format |
Reading:
windkit.read_gwc() reads generalized wind climates:
# Read from LIB file
gwc = wk.read_gwc("generalized.lib")
Writing:
windkit.gwc_to_file() writes generalized wind climates to .lib files:
wk.gwc_to_file(gwc, "output.lib")
Creating from Arrays#
gen_heights = np.array([10, 25, 50, 100, 200])
gen_roughnesses = np.array([0.0, 0.03, 0.1, 0.3, 1.5])
A = np.random.rand(5, 5, 12) * 10
k = np.random.rand(5, 5, 12) + 1
wdfreq = np.random.rand(5, 5, 12)
wdfreq = wdfreq / wdfreq.sum(axis=2, keepdims=True)
gwc = xr.Dataset(
data_vars=dict(
A=(("gen_height", "gen_roughness", "sector"), A),
k=(("gen_height", "gen_roughness", "sector"), k),
wdfreq=(("gen_height", "gen_roughness", "sector"), wdfreq),
),
coords=dict(
gen_height=(("gen_height",), gen_heights),
gen_roughness=(("gen_roughness",), gen_roughnesses),
sector=(("sector",), (wdbins[1:] + wdbins[:-1]) / 2.0),
sector_floor=(("sector_floor",), np.mod(wdbins[:-1], 360)),
sector_ceil=(("sector_ceil",), np.mod(wdbins[1:], 360)),
)
)
gwc
<xarray.Dataset> Size: 8kB
Dimensions: (gen_height: 5, gen_roughness: 5, sector: 12,
sector_floor: 12, sector_ceil: 12)
Coordinates:
* gen_height (gen_height) int64 40B 10 25 50 100 200
* gen_roughness (gen_roughness) float64 40B 0.0 0.03 0.1 0.3 1.5
* sector (sector) float64 96B 0.0 30.0 60.0 90.0 ... 270.0 300.0 330.0
* sector_floor (sector_floor) float64 96B 345.0 15.0 45.0 ... 285.0 315.0
* sector_ceil (sector_ceil) float64 96B 15.0 45.0 75.0 ... 315.0 345.0
Data variables:
A (gen_height, gen_roughness, sector) float64 2kB 8.333 ... ...
k (gen_height, gen_roughness, sector) float64 2kB 1.642 ... ...
wdfreq (gen_height, gen_roughness, sector) float64 2kB 0.08418 .....Usage in WAsP Methodology#
GWC is central to WAsP’s horizontal extrapolation:
Generalization - Remove local terrain effects from observed wind climate to create GWC
Downscaling - Apply terrain effects at new locations using the GWC
This is done in PyWAsP:
import pywasp as pw
# Generalize observed wind climate
gwc = pw.wasp.generalize(bwc, topo_map)
# Downscale to new locations
wwc = pw.wasp.downscale(gwc, topo_map, output_locs)
See WAsP Flow Model for details.
Validation#
windkit.validate_gwc()- Validate GWC dataset structurewindkit.is_gwc()- Check if dataset is valid GWC
wk.is_gwc(gwc)
True