hygrometry package

Module contents

hygrometry module.

To install:

pip install git+https://github.com/bluthen/hygrometry.git

Sources and Citations:

[BriceHalls](1, 2, 3) Tim Brice, Todd Halls. Javascript wet bulb calculator. http://www.srh.noaa.gov/epz/?n=wxcalc_rh
[SensHumGl]Sensirion. Humidity at a Glance. https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity_Sensors/Sensirion_Humidity_Sensors_Introduction_to_Relative_Humidity_V2.pdf
[SensIntroHum](1, 2, 3, 4) Sensirion. Introduction to Humidity. https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity_Sensors/Sensirion_Humidity_Sensors_at_a_Glance_V1.pdf
[NOAAHeatIndex]The Heat Index Equation. http://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml
[PlanetAbsHum]PlanetCalc. Relative humidity to absolute humidity and vise versa calculators. http://planetcalc.com/2167/
Example:
>>> import hygrometry
>>> hygrometry.conv_f2c(70.0)
21.111128
hygrometry.absolute_humidity(t, rh)

Gives you the mass of water vapor in volume of dry air. Units in g/m^3 See [SensIntroHum]

Different pressure seem to affect absolute humidity slightly. For a more accurate calculation that uses pressure, see [PlanetAbsHum].

Parameters:
  • t (float) – Temperature in Celsius.
  • rh – Relative Humidity 0-100
Returns:

Absolute humidity g/m^3

Return type:

float

Example:
>>> import hygrometry
>>> hygrometry.absolute_humidity(25, 60)
13.780667458722558
hygrometry.calc_es_v_dew(t_c, rh)

Calculates vapor pressure, saturation vapor pressure, and dew point in celcius. See [BriceHalls]

Parameters:
  • t_c (float) – Temperature in Celcius.
  • rh (float) – Relative humdity 0-100
Returns:

[vapor pressure, saturation vapor pressure, dew point]

Return type:

[float, float, float]

Example:
>>> import hygrometry
>>> hygrometry.calc_es_v_dew(20.1, 50.3)
[23.514683799663736, 11.827885951230858, 9.451033779734948]
hygrometry.calc_wb(e_difference, t_w_guess, c_temp, mb_pressure, e2, previoussign, incr)

Incremental wetbulb calculation. See [BriceHalls]

Recommend not to use directly, use wetbulb() instead

hygrometry.conv_c2f(c)

Convert Celsius to Fahrenheit

Parameters:

c (float) – Temperature in Celsius

Returns:

Temperature in Fahrenheit

Return type:

float

Example:
>>> import hygrometry
>>> hygrometry.conv_c2f(21.111128)
70.0000304
hygrometry.conv_f2c(f)

Convert fahrenheit to Celsius

Parameters:

f (float) – Temperature in Fahrenheit

Returns:

Temperature in Celsius

Return type:

float

Example:
>>> import hygrometry
>>> hygrometry.conv_f2c(70.0)
21.111128
hygrometry.dew(t_c, rh)

Gives you the Dew point given a RH at a Temperature. See [SensIntroHum]

Parameters:
  • t_c (float) – Temperature in Celsius
  • rh (float) – Relative Humidity 0-100
Returns:

Dew point in Celsius

Return type:

float

Example:
>>> import hygrometry
>>> hygrometry.dew(25, 60)
16.693149006198954
hygrometry.heat_index(t, rh)

Gives you the heat index in Celsius. See [NOAAHeatIndex]

Parameters:
  • t (float) – Temperature in Celsius
  • rh (float) – Relative humidity 0-100
Returns:

Heat index in Celsius.

Return type:

float

Example:
>>> import hygrometry
>>> hygrometry.heat_index(25, 80)
25.644464960000008
hygrometry.humidity_adjust_temp(rh1, t_c1, t_c2)

Gives you would the relative humidity would be if just the temperature changed. See: [SensIntroHum]

Parameters:
  • rh1 (float) – Initial relative humidity 0-100
  • t_c1 (float) – Initial temperature in Celsius.
  • t_c2 (float) – The temperature to find the new RH at.
Returns:

The adjusted RH (0-100) at Temperature t_c2

Return type:

float

Example:
>>> import hygrometry
>>> hygrometry.humidity_adjust_temp(60, 25, 30)
44.784059201238314
hygrometry.mixing_ratio(t, rh, p)

Gives you the mixing ratio in g/kg. See [SensIntroHum]

Parameters:
  • t (float) – Temperature in Celsius
  • rh (float) – Relative humidity 0-100
  • p (float) – Barometric Air pressure in hPa
Returns:

Mixing ratio g/kg

Return type:

float

Example:
>>> import hygrometry
>>> hygrometry.mixing_ratio(30, 80, 980)
22.266502023175242
hygrometry.wetbulb(t_c, rh, p)

Calculate Wet bulb in Celcius given temperature, relative humidity, and pressure. See: [BriceHalls]

Parameters:
  • t_c (float) – Temperature in Celcius.
  • rh (float) – Relative humdity 0-100
  • p (float) – Pressure in hPa
Example:
>>> import hygrometry
>>> hygrometry.wetbulb(40, 50, 3)
27.62960000000001