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 tutorial data for the Serra Santa Luzia site in Portugal:

path = wk.get_tutorial_data("serra_santa_luzia")

The tutorial data folder contains:

  • bwc.omwc - Observed wind climate (WAsP format)

  • SerraSantaLuzia.map - Elevation and roughness (WAsP map format)

  • turbines.csv - Turbine positions

  • Bonus1MW.wtg - Turbine power curve (WAsP format)

Create a Topography Map#

Read elevation and roughness from the WAsP map file:

elev = wk.read_elevation_map(path / "SerraSantaLuzia.map")
rgh = wk.read_roughness_map(path / "SerraSantaLuzia.map")
topo_map = pw.wasp.TopographyMap(elev, rgh)

Generalize the Wind Climate#

Load the observed wind climate, reproject to match the map CRS, and remove terrain effects:

bwc = wk.read_bwc(path / "bwc.omwc", crs="EPSG:4326")
bwc = wk.spatial.reproject(bwc, "EPSG:32629")
gwc = pw.wasp.generalize(bwc, topo_map)
gwc
<xarray.Dataset> Size: 4kB
Dimensions:        (point: 1, sector: 12, gen_roughness: 5, gen_height: 5)
Coordinates:
    height         (point) float64 8B 25.3
    south_north    (point) float64 8B 4.621e+06
    west_east      (point) float64 8B 5.147e+05
  * 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_roughness  (gen_roughness) float64 40B 0.0 0.03 0.1 0.4 1.5
  * gen_height     (gen_height) int64 40B 10 25 50 100 250
    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:          2026-01-29T14:38:53+00:00:\twindkit==2.0.0\tcreate_data...
    description:      SerraSantaluzia
    Package name:     windkit
    Package version:  2.0.0
    Creation date:    2026-01-29T14:38:53+00:00
    Object type:      Geostrophic Wind Climate
    author:           Neil Davis
    author_email:     neda@dtu.dk
    institution:      DTU Wind and Energy Systems
    title:            Generalized wind climate

Predict Wind Climate at Turbines#

Load turbine positions and downscale the wind climate:

turbines = wk.read_wind_turbines(path / "turbines.csv", crs="EPSG:32629")
wwc = pw.wasp.downscale(gwc, topo_map, output_locs=turbines)
wwc
<xarray.Dataset> Size: 3kB
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) int64 120B 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    wtg_key        (point) object 120B 'Bonus 1MW' 'Bonus 1MW' ... 'Bonus 1MW'
    crs            int8 1B 0
Dimensions without coordinates: point
Data variables:
    A              (sector, point) float32 720B 7.428 7.399 7.054 ... 7.75 8.305
    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.435 7.257 6.978 ... 7.548 7.818 8.102
    power_density  (point) float32 60B 414.6 385.4 340.9 ... 426.1 481.9 532.1
Attributes:
    Conventions:      CF-1.8
    history:          2026-01-29T14:38:53+00:00:\twindkit==2.0.0\tcreate_data...
    title:            WAsP site effects
    Package name:     windkit
    Package version:  2.0.0
    Creation date:    2026-01-29T14:38:54+00:00
    Object type:      Met fields
    author:           Neil Davis
    author_email:     neda@dtu.dk
    institution:      DTU Wind and Energy Systems

Calculate AEP#

Load the turbine model and calculate gross annual energy production:

wtg = wk.read_wtg(path / "Bonus1MW.wtg")
aep = pw.gross_aep(wwc, wtg)
aep
<xarray.Dataset> Size: 2kB
Dimensions:           (point: 15, sector: 12)
Coordinates:
    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) int64 120B 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    wtg_key           (point) object 120B 'Bonus 1MW' ... 'Bonus 1MW'
  * 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
    crs               int8 1B 0
Dimensions without coordinates: point
Data variables:
    gross_aep         (point) float32 60B 2.797 2.661 2.449 ... 3.064 3.278
    gross_aep_sector  (point, sector) float32 720B 0.1428 0.08569 ... 0.2184
Attributes:
    Conventions:      CF-1.8
    history:          2026-01-29T14:38:53+00:00:\twindkit==2.0.0\tcreate_data...
    title:            WAsP site effects
    Package name:     windkit
    Package version:  2.0.0
    Creation date:    2026-01-29T14:38:54+00:00
    Object type:      Anual Energy Production
    author:           Neil Davis
    author_email:     neda@dtu.dk
    institution:      DTU Wind and Energy Systems
total_aep = float(aep["gross_aep"].sum())
print(f"Total gross AEP: {total_aep:.2f} GWh")
Total gross AEP: 41.65 GWh

Next Steps#

Calculate Net AEP

Add wake effects, losses, and uncertainty.

Calculate AEP
Tutorials

Work through detailed examples.

Tutorials
Wind Climates

Understand wind climate types.

Wind Climates
WAsP Flow Model

Deep dive into terrain effects.

WAsP Flow Model