Basic Calculations

metpy.calc.basic

metpy.calc.basic.get_wind_speed(u, v)

Compute the wind speed from u and v-components.

Parameters:
  • u (array_like) – Wind component in the X (East-West) direction
  • v (array_like) – Wind component in the Y (North-South) direction
Returns:

wind speed – The speed of the wind

Return type:

array_like

metpy.calc.basic.get_wind_dir(u, v)

Compute the wind direction from u and v-components.

Parameters:
  • u (array_like) – Wind component in the X (East-West) direction
  • v (array_like) – Wind component in the Y (North-South) direction
Returns:

wind direction – The direction of the wind in degrees

Return type:

array_like

metpy.calc.basic.get_wind_components(speed, wdir)

Calculate the U, V wind vector components from the speed and direction.

Parameters:
  • speed (array_like) – The wind speed (magnitude)
  • wdir (array_like) – The wind direction, specified as the direction from which the wind is blowing.
Returns:

u, v – The wind components in the X (East-West) and Y (North-South) directions, respectively.

Return type:

tuple of array_like

See also

get_speed_dir()

Examples

>>> from metpy.units import units
>>> metpy.calc.get_wind_components(10. * units('m/s'), 225. * units.deg)
(<Quantity(7.071067811865475, 'meter / second')>,
 <Quantity(7.071067811865477, 'meter / second')>)
metpy.calc.basic.windchill(temperature, speed, face_level_winds=False, mask_undefined=True)

Calculate the Wind Chill Temperature Index (WCTI) from the current temperature and wind speed.

Specifically, these formulas assume that wind speed is measured at 10m. If, instead, the speeds are measured at face level, the winds need to be multiplied by a factor of 1.5 (this can be done by specifying face_level_winds as True.)

Parameters:
  • temp (array_like) – The air temperature
  • speed (array_like) – The wind speed at 10m. If instead the winds are at face level, face_level_winds should be set to True and the 1.5 multiplicative correction will be applied automatically.
Returns:

The corresponding Wind Chill Temperature Index value(s)

Return type:

array_like

Other Parameters:
 
  • face_level_winds (bool, optional) – A flag indicating whether the wind speeds were measured at facial level instead of 10m, thus requiring a correction. Defaults to False.
  • mask_undefined (bool, optional) – A flag indicating whether a masked array should be returned with values where wind chill is undefined masked. These are values where the temperature > 50F or wind speed <= 3 miles per hour. Defaults to True.

See also

heat_index()

References

[4]http://www.ofcm.gov/jagti/r19-ti-plan/pdf/03_chap3.pdf
metpy.calc.basic.heat_index(temperature, rh, mask_undefined=True)

Calculate the Heat Index from the current temperature and relative humidity.

The implementation uses the formula outlined in [6].

Parameters:
  • temp (array_like) – Air temperature
  • rh (array_like) – The relative humidity expressed as a percentage in the range [0, 100].
  • Returns (array_like) – The corresponding Heat Index value(s)
Other Parameters:
 

mask_undefined (bool, optional) – A flag indicating whether a masked array should be returned with values where heat index is undefined masked. These are values where the temperature < 80F or relative humidity < 40 percent. Defaults to True.

See also

windchill()

References

[5]Steadman, R.G., 1979: The assessment of sultriness. Part I: A temperature-humidity index based on human physiology and clothing science. J. Appl. Meteor., 18, 861-873.
[6]http://www.srh.noaa.gov/ffc/html/studies/ta_htindx.PDF