Quick Overview#
This quick overview walks you through a complete wind resource assessment workflow in PyWAsP. By the end, you’ll have calculated the annual energy production (AEP) for wind turbines at a real site.
Note
Make sure you have PyWAsP installed and your license
configured (pywasp configure) before starting.
Import Libraries#
import pywasp as pw
import windkit as wk
Get Tutorial Data#
Download and load tutorial data for the Serra Santa Luzia site in Portugal:
data = wk.load_tutorial_data("serra_santa_luzia")
The tutorial dataset contains:
data.bwc- Observed (binned) wind climatedata.elev/data.rgh- Elevation and roughness mapsdata.turbines- Turbine positionsdata.wtg- Turbine power curve
Like WAsP, PyWAsP treats the wind directions of the observed wind climate as
relative to the grid north of the maps, and warns unless wind_dir_crs says
so. Set it to the map projection (UTM zone 29N);
Tutorial 9 explains direction frames:
bwc = data.bwc.assign_attrs(wind_dir_crs="EPSG:32629")
Create a Topography Map#
Combine elevation and roughness into a topography map:
topo_map = pw.wasp.TopographyMap(data.elev, data.rgh)
Generalize the Wind Climate#
Remove terrain effects from the observed wind climate:
gwc = pw.wasp.generalize(bwc, topo_map)
gwc
<xarray.Dataset> Size: 4kB
Dimensions: (sector: 12, gen_height: 5, gen_roughness: 5, point: 1)
Coordinates:
* sector (sector) float64 96B 0.0 30.0 60.0 90.0 ... 270.0 300.0 330.0
sector_ceil (sector) float64 96B 15.0 45.0 75.0 ... 285.0 315.0 345.0
sector_floor (sector) float64 96B 345.0 15.0 45.0 ... 255.0 285.0 315.0
* gen_height (gen_height) int64 40B 10 25 50 100 200
* gen_roughness (gen_roughness) float64 40B 0.0 0.03 0.1 0.4 1.5
height (point) float64 8B 25.3
west_east (point) float64 8B 5.147e+05
south_north (point) float64 8B 4.621e+06
crs int8 1B 0
Dimensions without coordinates: point
Data variables:
A (sector, gen_height, gen_roughness, point) float32 1kB 5.6...
k (sector, gen_height, gen_roughness, point) float32 1kB 1.7...
wdfreq (sector, gen_height, gen_roughness, point) float32 1kB 0.0...
site_elev (point) float32 4B 381.0
Attributes:
Conventions: CF-1.8
history: 2025-06-03T07:02:54+00:00:\twindkit==0.8.2.dev48+g9f732...
description: SerraSantaluzia
Package name: windkit
Package version: 0.1.0.dev1+g565f937b5
Creation date: 2026-10-01T12:46:42+00:00
Object type: Weibull Wind Climate
author: Default User
author_email: default_email@example.com
institution: Default Institution
wind_dir_crs: PROJCRS["WGS 84 / UTM zone 29N",BASEGEOGCRS["WGS 84",EN...
title: Generalized wind climatePredict Wind Climate at Turbines#
Downscale the generalized wind climate to each turbine location:
wwc = pw.wasp.downscale(gwc, topo_map, output_locs=data.turbines)
wwc
<xarray.Dataset> Size: 4kB
Dimensions: (sector: 12, point: 15)
Coordinates:
* sector (sector) float64 96B 0.0 30.0 60.0 90.0 ... 270.0 300.0 330.0
sector_ceil (sector) float64 96B 15.0 45.0 75.0 ... 285.0 315.0 345.0
sector_floor (sector) float64 96B 345.0 15.0 45.0 ... 255.0 285.0 315.0
height (point) int64 120B 50 50 50 50 50 50 50 ... 50 50 50 50 50 50
south_north (point) int64 120B 4622313 4622199 ... 4624252 4624142
west_east (point) int64 120B 513914 514161 514425 ... 516060 516295
turbine_id (point) int64 120B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
group_id (point) float64 120B 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
wtg_key (point) <U9 540B 'Bonus 1MW' 'Bonus 1MW' ... 'Bonus 1MW'
crs int8 1B 0
Dimensions without coordinates: point
Data variables:
A (sector, point) float32 720B 7.427 7.398 ... 7.749 8.304
k (sector, point) float32 720B 2.029 2.037 ... 2.127 2.123
wdfreq (sector, point) float32 720B 0.06445 0.06485 ... 0.0792
site_elev (point) float32 60B 459.7 460.0 460.0 ... 520.0 520.0 520.0
air_density (point) float32 60B 1.163 1.163 1.163 ... 1.156 1.156 1.156
wspd (point) float32 60B 7.433 7.256 6.977 ... 7.547 7.816 8.101
power_density (point) float32 60B 414.4 385.1 340.8 ... 425.9 481.6 531.8
Attributes:
Conventions: CF-1.8
history: 2024-10-08T07:28:14+00:00:\twindkit==0.8.1.dev25+g2e8f1...
title: WAsP site effects
Package name: windkit
Package version: 0.1.0.dev1+g565f937b5
Creation date: 2026-10-01T12:46:43+00:00
Object type: Met fields
author: Default User
author_email: default_email@example.com
institution: Default InstitutionCalculate AEP#
Calculate the gross annual energy production with the turbine’s power curve:
aep = pw.gross_aep(wwc, data.wtg)
aep
<xarray.Dataset> Size: 2kB
Dimensions: (sector: 12, point: 15)
Coordinates:
* sector (sector) float64 96B 0.0 30.0 60.0 ... 270.0 300.0 330.0
sector_ceil (sector) float64 96B 15.0 45.0 75.0 ... 285.0 315.0 345.0
sector_floor (sector) float64 96B 345.0 15.0 45.0 ... 255.0 285.0 315.0
height (point) int64 120B 50 50 50 50 50 50 ... 50 50 50 50 50 50
south_north (point) int64 120B 4622313 4622199 ... 4624252 4624142
west_east (point) int64 120B 513914 514161 514425 ... 516060 516295
turbine_id (point) int64 120B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
group_id (point) float64 120B 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
wtg_key (point) <U9 540B 'Bonus 1MW' 'Bonus 1MW' ... 'Bonus 1MW'
crs int8 1B 0
Dimensions without coordinates: point
Data variables:
gross_aep_sector (sector, point) float32 720B 0.1428 0.1423 ... 0.2183
gross_aep (point) float32 60B 2.796 2.66 2.448 ... 2.871 3.063 3.277
Attributes:
Conventions: CF-1.8
history: 2024-10-08T07:28:14+00:00:\twindkit==0.8.1.dev25+g2e8f1...
title: WAsP site effects
Package name: windkit
Package version: 0.1.0.dev1+g565f937b5
Creation date: 2026-10-01T12:46:43+00:00
Object type: Anual Energy Production
author: Default User
author_email: default_email@example.com
institution: Default Institutiontotal_aep = float(aep["gross_aep"].sum())
print(f"Total gross AEP: {total_aep:.2f} GWh")
Total gross AEP: 41.64 GWh
Next Steps#
Add wake effects, losses, and uncertainty.
Work through detailed examples.
Understand wind climate types.
Deep dive into terrain effects.