pyiem.meteorology module#

We do meteorological things, when necessary

pyiem.meteorology.temperature_humidity_index(temperature, humidity)[source]#

Compute the Temperature Humidity Index

Parameters:
  • temperature (temperature) – The Air Temperature

  • humidity (humidity) – The Relative Humidity

Returns:

The THI

Return type:

temperature (temperature)

pyiem.meteorology.comprehensive_climate_index(airtemp, rh, windspeed, solarrad, shade_effect=False)[source]#

Compute the Comprehensive Climate Index.

Note: shade_effect multiplies the solarrad value by 0.2 (80% reduction)

Parameters:

shade_effect (bool)

pyiem.meteorology.clearsky_shortwave_irradiance_year(lat, elevation)[source]#

Compute the Clear Sky Shortwave Irradiance for year in MJ m**-2

Parameters:
  • lat (float) – latitude

  • elevation (float) – location elevation in meters

Returns:

irradiance (list)

pyiem.meteorology.drct(u, v)[source]#

Compute the wind direction given a u and v wind speed

Parameters:
  • u (dt.speed) – u component wind speed

  • v (dt.speed) – v component wind speed

Returns:

dt.direction value

pyiem.meteorology.uv(speed, direction)[source]#

Compute the u and v components of the wind @param wind speed in whatever units @param dir wind direction with zero as north @return u and v components

pyiem.meteorology.mcalc_feelslike(tmpf, dwpf, smps, mask_undefined=False)[source]#

Compute a feels like temperature

Parameters:
  • temperature (temperature) – The dry bulb temperature

  • dewpoint (temperature) – The dew point temperature

  • speed (speed) – the wind speed

  • mask_undefined (bool) – If True, mask values where feels like is undef.

Returns:

The feels like temperature

Return type:

temperature (temperature)

pyiem.meteorology.windchill(temperature, speed)[source]#

Compute the wind chill temperature

http://www.ofcm.gov/publications/reports2.htm

Parameters:
  • temperature (temperature) – The Air Temperature

  • speed (speed) – The Wind Speed

Returns:

The Wind Chill Temperature

Return type:

temperature (temperature)

pyiem.meteorology.heatindex(temperature, polyarg)[source]#

Compute the heat index based on

Stull, Richard (2000). Meteorology for Scientists and Engineers, Second Edition. Brooks/Cole. p. 60. ISBN 9780534372149.

Another opinion on appropriate equation: http://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml

http://www.weather.gov/media/ffc/ta_htindx.PDF

pyiem.meteorology.dewpoint_from_pq(pressure, mixingratio)[source]#

Compute the Dew Point given a Pressure and Mixing Ratio

pyiem.meteorology.dewpoint(temperature, relhumid)[source]#

Compute Dew Point given a temperature and RH%

pyiem.meteorology.relh(temperature, _dewpoint)[source]#

Compute Relative Humidity based on a temperature and dew point

pyiem.meteorology.mixing_ratio(_dewpoint)[source]#

Compute the mixing ratio

Parameters:

dewpoint (temperature) – Dew Point temperature

Returns:

mixing ratio

pyiem.meteorology.gdd(high, low, base=50.0, ceiling=86.0)[source]#

Compute Growing Degree Days

Parameters:
  • high (temperature, or metpy.units) – High Temperature

  • low (temperature or metpy.units) – Low Temperature

  • base (int) – Base to use in GDD Computation (F)

  • ceiling (int) – Ceiling to use in GDD Computation (F)

Returns:

float value for GDDs