earthkit.meteo.wind.array.polar_to_xy

earthkit.meteo.wind.array.polar_to_xy(magnitude, direction, convention='meteo')

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

Parameters:
  • magnitude (array-like) – Speed/magnitude of the vector

  • direction (array-like) – 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 – X vector component (same units as magnitude)

  • array-like – Y vector component (same units as magnitude)

Return type:

tuple[ArrayLike, ArrayLike]

Notes

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