.. |deg| unicode:: U+00B0 # Degree symbol
.. module:: windkit
.. _windkit_api:
=================
API Reference
=================
|
---------------------------
Wind Conditions
================
The WindKit API provides a set of functions to work with wind conditions, the "raw" wind speed and direction data,
and wind climates in specific formats: time-series, histogram, weibull, and the WAsPs generalized wind climate and geostrophic wind climate formats.
Wind functions
----------------------
.. autosummary::
:toctree: wind_funcs_autogen
wind_speed
wind_direction
wind_speed_and_direction
wind_vectors
wind_direction_difference
wd_to_sector
vinterp_wind_direction
vinterp_wind_speed
rotor_equivalent_wind_speed
Wind climate functions
------------------------------
.. autosummary::
:toctree: wind_climate_autogen
create_met_fields
mean_ws_moment
ws_cdf
ws_freq_gt_mean
mean_wind_speed
mean_power_density
get_cross_predictions
Time Series Wind Climate (TSWC)
---------------------------------
.. autosummary::
:toctree: tswc_autogen
validate_tswc
is_tswc
create_tswc
read_tswc
tswc_from_dataframe
tswc_resample
Long-term correction
------------------------
The long-term correction (LTC) module provides functionality for performing long-term corrections on wind time series data. It includes methods for linear regression and variance ratio methods.
.. autosummary::
:toctree: ltc_autogen
ltc.LinRegMCP
ltc.VarRatMCP
Binned Wind Climate (BWC)
---------------------------
.. autosummary::
:toctree: bwc_autogen
validate_bwc
is_bwc
create_bwc
read_bwc
bwc_from_tswc
bwc_to_file
combine_bwcs
weibull_fit
Weibull Wind Climate (WWC)
--------------------------
.. autosummary::
:toctree: wwc_autogen
validate_wwc
is_wwc
create_wwc
read_wwc
read_mfwwc
wwc_to_file
wwc_to_bwc
weibull_combined
Generalized Wind Climate (GWC)
-------------------------------
.. autosummary::
:toctree: gwc_autogen
validate_gwc
is_gwc
create_gwc
read_gwc
gwc_to_file
Geostrophic Wind Climate (GeoWC)
---------------------------------
.. autosummary::
:toctree: bwc_autogen
validate_geowc
is_geowc
|
-----------------------------------
Topography
=====================
:ref:`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.
Landcover
-----------------
.. autosummary::
:toctree: lc_table_autogen
LandCoverTable
get_landcover_table
add_landcover_table
roughness_to_landcover
landcover_to_roughness
read_roughness_map
read_landcover_map
landcover_map_to_file
roughness_map_to_file
Elevation
------------------
.. autosummary::
:toctree: lc_table_autogen
read_elevation_map
elevation_map_to_file
Raster maps
----------------
.. autosummary::
:toctree: lc_table_autogen
create_raster_map
get_raster_map
Vector maps
----------------
.. autosummary::
:toctree: lc_table_autogen
create_vector_map
get_vector_map
Map conversion
----------------
.. autosummary::
:toctree: lc_table_autogen
lines_to_polygons
polygons_to_lines
snap_to_layer
check_dead_ends
check_lines_cross
|
-----------------------------------
Wind Farm
==================
Wind Turbines
------------------
.. autosummary::
:toctree: wind_turbines_autogen
validate_windturbines
is_windturbines
check_wtg_keys
create_wind_turbines_from_dataframe
create_wind_turbines_from_arrays
wind_turbines_to_geodataframe
Wind Turbine Generators (WTG)
------------------------------
Windkit's wind turbine API has routines to load both wind turbine generator power curves, and to create layouts of wind farms.
.. autosummary::
:toctree: wtg_autogen
validate_wtg
is_wtg
RegulationType
estimate_regulation_type
read_wtg
wtg_power
wtg_cp
wtg_ct
Losses and Uncertainty
-----------------------
Windkit has support for basic loss and uncertainty calculations to obtain, for example, a p90 of AEP estimates.
.. autosummary::
:toctree: l_and_u_autogen
validate_uncertainty_table
get_uncertainty_table
total_uncertainty
uncertainty_table_summary
total_uncertainty_factor
|
-----------------------------------
Spatial
==================
The WindKit Geospatial Tools allow you to perform common GIS functions such as convert between the different :ref:`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.
* geodf - either a `geopandas.GeoDataFrame` or `geopandas.GeoSeries`
* xr_data - either an `xarray.DataArray` or `xarray.Dataset`
* CRS - `pyproj.crs.CRS`
Coordinate Reference System
-----------------------------
.. autosummary::
:toctree: crs_autogen
spatial.get_crs
spatial.add_crs
spatial.set_crs
spatial.crs_are_equal
Bounding Box
------------------
.. autosummary::
:toctree: bbox_autogen
spatial.BBox
Create spatial objects
-----------------------
.. autosummary::
:toctree: create_spatial_autogen
spatial.create_dataset
spatial.create_raster
spatial.create_point
spatial.create_stacked_point
spatial.create_cuboid
Validate spatial objects
-------------------------
.. autosummary::
:toctree: validate_spatial_autogen
spatial.is_point
spatial.is_stacked_point
spatial.is_cuboid
spatial.is_raster
Convert between spatial objects
-------------------------------
.. autosummary::
:toctree: convert_spatial_autogen
spatial.to_point
spatial.to_cuboid
spatial.to_stacked_point
spatial.to_raster
spatial.gdf_to_ds
spatial.ds_to_gdf
Interpolation
------------------
.. autosummary::
:toctree: interpolation_autogen
spatial.interp_structured_like
spatial.interp_unstructured
spatial.interp_unstructured_like
Comparison
------------------
.. autosummary::
:toctree: spatial_comparison_autogen
spatial.are_spatially_equal
spatial.equal_spatial_shape
spatial.covers
Spatial operations
------------------
.. autosummary::
:toctree: spatial_operations_autogen
spatial.clip
spatial.clip_with_margin
spatial.mask
spatial.nearest_points
spatial.reproject
spatial.warp
spatial.add_projected_wrf_coordinates
spatial.count_spatial_points
|
-----------------------------------
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.
.. autosummary::
:toctree: plotting_autogen
plot.histogram
plot.histogram_lines
plot.operational_curves
plot.raster_plot
plot.roughness_rose
plot.time_series
plot.vertical_profile
plot.wind_rose
plot.color
plot.landcover_map
|
-----------------------------------
Other
==================
Tutorial data
------------------
.. autosummary::
:toctree: tutorial_autogen
get_tutorial_data
Weibull distribution
--------------------
.. autosummary::
:toctree: weibull_autogen
weibull.fit_weibull_wasp_m1_m3_fgtm
weibull.fit_weibull_wasp_m1_m3
weibull.fit_weibull_k_sumlogm
weibull.weibull_moment
weibull.weibull_pdf
weibull.weibull_cdf
weibull.weibull_freq_gt_mean
weibull.get_weibull_probability
WAsP
------------------
.. autosummary::
:toctree: workspace_autogen
Workspace
WengWorkspace
read_cfdres
Coordinates
------------------
.. autosummary::
:toctree: coordinates_autogen
create_sector_coords
create_wsbin_coords
Get reanalysis data
-------------------
.. autosummary::
:toctree: reanalysis_autogen
get_era5