earthkit.meteo.wind.array.xy_to_polar

earthkit.meteo.wind.array.xy_to_polar(x, y, convention='meteo')

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

Parameters:
  • x (array-like) – u wind/x vector component

  • y (array-like) – v wind/y vector component (same units as u)

  • convention (str) –

    Specify how the direction/angle component of the target polar coordinate system is interpreted. The possible values are as follows:

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

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

Returns:

  • array-like – Magnitude (same units as u)

  • array-like – Direction (degrees)

Return type:

tuple[ArrayLike, ArrayLike]

Notes

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