windkit.ws_cdf#
- windkit.ws_cdf(wc_obj, *, bysector=False, ws_bins=None, n_sectors=None)[source]#
Calculate the wind speed cumulative distribution function from a wind climate.
- Parameters:
wc_obj (xarray.Dataset) – Binned, Weibull or time series wind climate.
bysector (bool) – Calculate the CDF by sector, defaults to False. For a Weibull wind climate the all-sector CDF is the
wdfreq-weighted sum of the sectorwise CDFs. A time series wind climate is binned into sectors withwindkit.wd_to_sector(), skipping samples without a direction.ws_bins (int or array_like, optional) – Wind speed bins to evaluate the CDF of a Weibull or time series wind climate on, as accepted by
windkit.create_wsbin_coords(). Defaults to its default bins. A binned wind climate uses its own bins.n_sectors (int, optional) – Number of sectors to bin a time series wind climate into when
bysectoris True. Defaults to 12.
- Returns:
wind_speed_cdf, the CDF at thewsceilof eachwsbin. For a Weibull or time series wind climate this is the exact CDF: the frequency below the ceiling, which stays below 1 if some wind speeds exceed the last ceiling. A binned wind climate holds only the frequencies within its bins, so its CDF reaches 1 at the last ceiling. A time series counts the samples strictly below each ceiling, so a speed on a ceiling counts in the bin above, as inwindkit.bwc_from_tswc(), except that its last bin also holds speeds equal to the last ceiling.- Return type:
- Raises:
ValueError – If
wc_objis not a known wind climate,ws_binsis given for a binned wind climate, orn_sectorsis given for anything but a time series wind climate withbysector=Trueor is not a positive integer.