Last active
September 26, 2018 20:22
-
-
Save moonpyk/5fc7072470fb0f8e89b60bb87aa304ba to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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