Skip to content

Instantly share code, notes, and snippets.

@ivanzvonkov
Created September 17, 2020 11:44
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/c019fedfa656b5d385fd0a966adca5ec to your computer and use it in GitHub Desktop.
Save ivanzvonkov/c019fedfa656b5d385fd0a966adca5ec to your computer and use it in GitHub Desktop.
import numpy as np
def calculate_abs_humidity_np(temperature, relative_humidity):
""" Calculates absolute humidity from temperature and relative humidity """
t = temperature
rh = relative_humidity
abs_humidity = (6.112 * np.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