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 vectordirection (
array-like | xarray.DataArray) – Direction of the vector (degrees)convention (
str) –Specify how
directionis interpreted. The possible values are as follows:”meteo”:
directionis the meteorological wind direction (seedirection()for explanation)”polar”:
directionis the angle measured anti-clockwise from the x axis (East/right) to the vector
- Returns:
array-like | xarray.DataArray– X vector component (same units asmagnitude)array-like | xarray.DataArray– Y vector component (same units asmagnitude)
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:earthkit.meteo.wind.array.polar_to_xy()for array-likeearthkit.meteo.wind.xarray.polar_to_xy()for xarray.DataArray
The function returns an object of the same type as the input arguments.