Skip to content

Instantly share code, notes, and snippets.

@lrodorigo
Created June 27, 2023 11:32
Show Gist options
  • Save lrodorigo/9d08ac68db1731c09472372e1047d24f to your computer and use it in GitHub Desktop.
Save lrodorigo/9d08ac68db1731c09472372e1047d24f to your computer and use it in GitHub Desktop.
@staticmethod
def get_dew_point(t_air_c, rel_humidity):
"""Compute the dew point in degrees Celsius
:param t_air_c: current ambient temperature in degrees Celsius
:type t_air_c: float
:param rel_humidity: relative humidity in %
:type rel_humidity: float
:return: the dew point in degrees Celsius
:rtype: float
"""
A = 17.27
B = 237.7
alpha = ((A * t_air_c) / (B + t_air_c)) + math.log(rel_humidity / 100.0)
return (B * alpha) / (A - alpha)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment