Skip to content

Instantly share code, notes, and snippets.

@ivanzvonkov
Last active September 17, 2020 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanzvonkov/af55cdb3704e6d8af0f42fe7500dc752 to your computer and use it in GitHub Desktop.
Save ivanzvonkov/af55cdb3704e6d8af0f42fe7500dc752 to your computer and use it in GitHub Desktop.
import math
def calculate_abs_humidity(temperature, relative_humidity):
""" Calculates absolute humidity from temperature and relative humidity """
t = temperature
rh = relative_humidity
abs_humidity = (6.112 * math.exp((17.67*t)/(t+243.5)) * rh * 2.1674)/(273.15+t)
return abs_humidity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment