windkit.mean_wind_speed#

windkit.mean_wind_speed(wc_obj, *, bysector=False, n_sectors=None)[source]#

Calculate the mean wind speed from a wind climate.

Parameters:
  • wc_obj (xarray.Dataset) – Binned, Weibull or time series wind climate.

  • bysector (bool) – Calculate the mean by sector, defaults to False. A time series wind climate is binned into sectors with windkit.wd_to_sector(), skipping samples without a direction.

  • n_sectors (int, optional) – Number of sectors to bin a time series wind climate into when bysector is True. Defaults to 12.

Returns:

mean_wind_speed. Missing samples of a time series are skipped, and a sector without samples gives NaN.

Return type:

xarray.DataArray

Raises:

ValueError – If wc_obj is not a known wind climate, or n_sectors is given for anything but a time series wind climate with bysector=True or is not a positive integer.