WindKit API

The windkit module contains several modules for reading and writing WAsP specific files, as well as performing common geospatial operations on these datasets. These are split into three groups, wind climate data, topographic data, and geospatial tools. You can find an introduction to each of these areas below.

Wind Climate objects

WAsP works with a number of different Wind Climate Objects, which each have their own API. All wind climates have an xarray.Dataset backend that can be used to provide wind specific calculations.

time_series_wind_climate

Time series wind climate module

binned_wind_climate

Binned wind climate module

generalized_wind_climate

Generalized wind climate module

weibull_wind_climate

Weibull wind climate module

Wind Climate tools

Tools to work with windkit wind climate objects.

sector

Routines for working with the sector coordinate.

weibull

Utility functions for Weibull distributions

wind

Utility functions for working with wind data

wind_climate

Wind climate functions.

wind_data

Module for downloading wind time series and wind climates from models and observations.

Topographic Data

Topographic Data provides the roughness and elevation data that is used to model the wind resource. The tools in WindKit allow you to work with both raster and vector based maps, and use the powerful GDAL library behind the scenes to enable a wide variety of file formats to be used.

vector_map

Readers and writers for vectormap objects.

raster_map

Contains class and class methods to manipulate topographic raster files

elevation_map

Module to handle elevation maps.

roughness_map

Module to handle roughness maps.

landcover

Class and associated class methods to work with landcover tables.

windkit.get_map(bbox[, dataset, band, source])

Download a map from the planetary computer or google earth engine.

map_conversion.lines2poly(line_gdf[, bbox, ...])

Convert a geodataframe of lines to a geodataframe of polygons.

map_conversion.poly2lines(poly_gdf[, ...])

Convert a geodataframe of polygons to a geodataframe of lines.

Geospatial Tools

The WindKit Geospatial Tools allow you to perform common GIS functions such as convert between the different Geospatial structures, reproject or warp the data into common projections, and clip or mask the data based on additional data sources.

In addition to the provided tools, since WindKit stores its objects in the formats of powerful python libraries, you can also make use of additional geopandas functions for vector data, and additional xarray functions for raster data.

Throughout this documentation, the following abbreviations are used to reference different data types.

spatial

A collection of functions for working with geospatial object supported by WindKit.

spatial.BBox(ring, crs)

WindKit Bounding Box

spatial.add_crs(obj, crs)

Adds a Coordinate Reference System to a WindKit object.

spatial.get_crs(obj)

Returns a pyproj.crs.CRS object from object metadata.

spatial.crs_are_equal(obj_a, obj_b)

Check if CRS's of two WindKit objects are equal

spatial.mask(obj, mask[, all_touched, ...])

Mask WindKit object with geometric mask.

spatial.reproject(obj, to_crs[, copy])

Reprojects WindKit object a new CRS without changing the data.

spatial.clip(obj, mask[, all_touched, ...])

Clip object to mask.

spatial.warp(obj, to_crs[, resolution, ...])

Warp cuboid WindKit object to another in a new CRS using data interpolation.

spatial.create_dataset(west_east, ...[, ...])

Create a WindKit dataset given a set of locations.

Plotting

WindKit Plotting allows you to execute a number of different plotting functions in order to visualize and analyze your data. Plots are largely broken into two categories; statistical and maps. Statistical plots are generally plotted using Plotly and Dash Python libraries at a single location, e.g. mast or turbine location, while maps use geopandas and xarray functions directly to show an overview of the area.

plot

Plotting functionality for WindKit objects

plot.histogram(ds[, style, color, weibull, ...])

Plot the histogram represented in a binned wind climate.

plot.histogram_lines(ds[, colors, gap])

Create a "distribution" plot and matching frequency wind rose for binned wind climate.

plot.operational_curves

Wind turbine generator operational curves.

plot.raster_plot(da[, contour, ...])

Creates a raster map plot.

plot.roughness_rose(ds[, style, gap])

Create roughness rose plot.

plot.time_series

Wind speed time-series plotting including wind speed and wind direction

plot.vertical_profile([da_meas, da_pred, ...])

Plots the vertical profile of the dataArray or dataArrays introduced.

plot.wind_rose(ds[, wind_speed_bins, style, ...])

Create wind rose plot.

plot.color

Helper functions for colors and colormaps.

plot.landcover_map(gdf[, plot_endpoints, ...])

Plot the polygons or lines dataframe as a map.

Windkit’s wind turbine API has routines to load both wind turbine generator power curves, and to create layouts of wind farms.

wind_turbine_generator

Wind Turbine classs defines the parameters of a certain type of wind turbine.

wind_turbines

Defines a wind_turbines object

Long Term Correction

Windkit allows to perform long term correction for wind time series using linear regresion or the variance ratio method.

ltc.mcp

Measure-Correlate-Predict MCP Module.

ltc.regression

Implements different regression methods to be used for the long term correction.

ltc.scores

Functions to calculate common scoring metrics to be used on windkit time series wind climate datasets.

Other data

Additional windkit functions.

empty

Create empty datasets for various WindKit structures.

workspace

WAsP Workspace module.

Metadata handling

Functions to handle metadata.

metadata

Variable Metadata for CF Conventions