earthkit.meteo.wind.xarray.direction¶
- earthkit.meteo.wind.xarray.direction(u, v, convention='meteo', to_positive=True)¶
Compute the direction/angle of a vector quantity.
- Parameters:
u (
xarray.DataArray) – u wind/x vector componentv (
xarray.DataArray) – v wind/y vector component (same units asu)convention (
str, optional) –Specify how the direction/angle is interpreted. The possible values are as follows:
”meteo”: the direction is the meteorological wind direction (see below for explanation)
”polar”: the direction is measured anti-clockwise from the x axis (East/right) to the vector
to_positive (
bool, optional) – If True, the resulting values are mapped into the [0, 360] range whenconventionis “polar”. Otherwise they lie in the [-180, 180] range.
- Returns:
Direction/angle (degrees)
- Return type:
xarray.DataArray
Notes
The meteorological wind direction is the direction from which the wind is blowing. Wind direction increases clockwise such that a northerly wind is 0°, an easterly wind is 90°, a southerly wind is 180°, and a westerly wind is 270°. The figure below illustrates how it is related to the actual orientation of the wind vector: