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]
earthkit.meteo.wind.polar_to_xy(magnitude: earthkit.data.FieldList, direction: earthkit.data.FieldList, convention: str = 'meteo') tuple[earthkit.data.FieldList, earthkit.data.FieldList]
earthkit.meteo.wind.polar_to_xy(magnitude: earthkit.data.Field, direction: earthkit.data.Field, convention: str = 'meteo') tuple[earthkit.data.Field, earthkit.data.Field]

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

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

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

  • array-like | xarray.DataArray | FieldList | Field – 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.