get_wind_dir

metpy.calc.get_wind_dir(u, v)[source]

Compute the wind direction from u and v-components.

Parameters
  • u (pint.Quantity) – Wind component in the X (East-West) direction

  • v (pint.Quantity) – Wind component in the Y (North-South) direction

  • convention (str) – Convention to return direction. ‘from’ returns the direction the wind is coming from (meteorological convention). ‘to’ returns the direction the wind is going towards (oceanographic convention). Default is ‘from’.

Returns

direction (pint.Quantity) – The direction of the wind in interval [0, 360] degrees, with 360 being North, with the direction defined by the convention kwarg.

Notes

In the case of calm winds (where u and v are zero), this function returns a direction of 0.

Deprecated since version 0.9.0: Function has been renamed to wind_direction and will be removed from MetPy in 0.12.0.