Skip to content

Instantly share code, notes, and snippets.

@moonpyk
Last active September 26, 2018 20:22
Show Gist options
  • Select an option

  • Save moonpyk/5fc7072470fb0f8e89b60bb87aa304ba to your computer and use it in GitHub Desktop.

Select an option

Save moonpyk/5fc7072470fb0f8e89b60bb87aa304ba to your computer and use it in GitHub Desktop.
from __future__ import print_function
from math import log, exp
def point_rosee(temperature, rh):
"""
Calcule le point de rosée
:param temperature: La temperature de l'air en °C
:param rh: L'humidité relative en %
:type rh: float
:type temperature: float
:return: Le point de rosée
"""
A = 6.112
m = 17.62
tn = 243.12
if temperature < 0.0:
m = 22.46
tn = 272.62
sd = A * exp(m * temperature / (tn + temperature))
d = sd * rh / 100.0
return tn * log(d / A) / (m - log(d / A))
if __name__ == '__main__':
print("A 10m d'altitude 50% d'humidite, le point de rosée de 20°C est", point_rosee(20, 50))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment