Last active
August 29, 2015 14:21
-
-
Save VincentLoy/c3a9b3bd97be049bb01f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# t is temperature in °C | |
# d is dew Point Temperature in °C | |
import math | |
def get_humidex(t, d): | |
kelvin = 273.15 | |
temperature = t + kelvin | |
dewpoint = d + kelvin | |
# Calculate vapor pressure in mbar. | |
e = 6.11 * math.exp(5417.7530 * ((1 / kelvin) - (1 / dewpoint))) | |
# Calculate saturation vapor pressure | |
h = 0.5555 * (e - 10.0) | |
humidex = temperature + h - kelvin | |
return humidex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment