windkit.wind.wind_direction_difference

windkit.wind.wind_direction_difference(wd_obs, wd_mod)[source]

Calculate the circular (minimum) distance between two directions (observed and modelled).

Parameters:
Returns:

xarray.DataArray

Return type:

circular (minimum) differences.

Examples

>>> wd_obs = xr.DataArray([15.0, 345.0, 355.0], dims=('time',))
>>> wd_mod = xr.DataArray([345.0, 300.0, 5.0], dims=('time',))
>>> wind_direction_difference(wd_obs, wd_mod)
<xarray.DataArray (time: 3)>
array([-30., -45.,  10.])
Dimensions without coordinates: time