earthkit.meteo.wind.fieldlist.xy_to_polar

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

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

Parameters:
  • x (FieldList|Field) – u wind/x vector component.

  • y (FieldList|Field) – v wind/y vector component (same units as u). Must be of the same type as u (FieldList or Field) and have the same number of fields 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:

  • FieldList|Field – Magnitude (same units as u). The result has the same type as the input (FieldList or Field).

  • FieldList|Field – Direction (degrees). The result has the same type as the input (FieldList or Field).

Return type:

tuple[earthkit.data.FieldList | earthkit.data.Field, earthkit.data.FieldList | earthkit.data.Field]

Notes

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