earthkit.meteo.wind.xarray.windrose¶
- earthkit.meteo.wind.xarray.windrose(speed, direction, sectors=16, speed_bins=None, percent=True)¶
Generate windrose data.
- Parameters:
speed (
xarray.DataArray) – Speeddirection (
xarray.DataArray) – Meteorological wind direction (degrees). Seeearthkit.meteo.wind.direction()for details. Values must be between 0 and 360.sectors (
number) – Number of sectors the 360 degrees direction range is split into.speed_bin (
array-like) – Speed binspercent (
bool) – If False, returns the number of valid samples in each bin. If True, returns the percentage of the number of samples in each bin with respect to the total number of valid samples.speed_bins (Iterable[float] | None)
- Returns:
xarray.DataArray– The bi-dimensional histogram ofspeedanddirection. Values inspeedare histogrammed along the first dimension and values indirectionare histogrammed along the second dimension.xarray.DataArray– The direction bins (i.e. the sectors) (degrees)
- Return type:
tuple[xarray.DataArray, xarray.DataArray]
Notes
The
sectorsparameter defines the number of direction bins in 360 degrees. The sectors do not start at 0 degrees (North) but are shifted by half a sector size. E.g. ifsectorsis 4 the sectors are defined as: