earthkit.meteo.wind.polar_to_xy

earthkit.meteo.wind.polar_to_xy(magnitude: ArrayLike, direction: ArrayLike, convention: str = 'meteo') tuple[ArrayLike, ArrayLike]
earthkit.meteo.wind.polar_to_xy(magnitude: xarray.DataArray, direction: xarray.DataArray, convention: str = 'meteo') tuple[xarray.DataArray, xarray.DataArray]

Convert wind/vector data from polar representation to xy representation.

Parameters:
  • magnitude (array-like | xarray.DataArray) – Speed/magnitude of the vector

  • direction (array-like | xarray.DataArray) – Direction of the vector (degrees)

  • convention (str) –

    Specify how direction is interpreted. The possible values are as follows:

    • ”meteo”: direction is the meteorological wind direction (see direction() for explanation)

    • ”polar”: direction is the angle measured anti-clockwise from the x axis (East/right) to the vector

Returns:

  • array-like | xarray.DataArray – X vector component (same units as magnitude)

  • array-like | xarray.DataArray – Y vector component (same units as magnitude)

Notes

In the target xy representation the x axis points East while the y axis points North.

Implementations

polar_to_xy() calls one of the following implementations depending on the type of the input arguments:

The function returns an object of the same type as the input arguments.