I want to add Dewpoint Depression and Wetbulb Formulas to the wxformulas.py
file. So far this is what I have
Dewpoint Depression:
def dewpointdepressF(t_F, rh):
"""Calculate dew point depression.
https://www.theweatherprediction.com/habyhints3/904/
t_f: Temperature in Fahrenheit
rh: relative humidity [0-100]
Returns: Dewpoint Depression
"""
if t_f is None or rh is None:
return None
dp_F = dewpointF(t_F, rh)
dp_D = t_F - dp_F
return dp_D if dp_D is not None else None
def dewpointdepressC(t_C, rh):
"""Calculate dew point depression.
https://www.theweatherprediction.com/habyhints3/904/
t_C: temperature in degree Celsius
rh: relative humidity [0-100]
Returns: Dewpoint Depression
"""
if t_C is None or rh is None:
return None
dp_C = dewpointC(t_C, rh)
dp_D = t_C - dp_C
return dp_D if dp_D is not None else None
Wetbulb:
def wetbulbF(t_F, rh):
"""Estimate the wetbulb temperature (1/3 method).
https://theweatherprediction.com/habyhints/170/
t_f: Temperature in Fahrenheit
rh: relative humidity [0-100]
dp_DwB: Dewpoint Depression divided by 3
t_WbF: Wetbulb Temperature in Fahrenheit
Returns: Wetbulb Temperature Estimation
"""
if t_f is None or rh is None:
return None
dp_F = dewpointF(t_F, rh)
dp_DwB = (t_F - dp_F) / 3
t_WbF = t_F - dp_DwB
return t_WbF if t_WbF is not None else None
def wetbulbC(t_C, rh):
"""Estimate the wetbulb temperature (1/3 method).
https://theweatherprediction.com/habyhints/170/
t_C: temperature in degree Celsius
rh: relative humidity [0-100]
dp_DwB: Dewpoint Depression divided by 3
t_WbC: Wetbulb Temperature in Celsius
Returns: Wetbulb Temperature Estimation
"""
if t_C is None or rh is None:
return None
dp_C = dewpointC(t_C, rh)
dp_DwB = (t_C - dp_C) / 3
t_WbC = t_C - dp_DwB
return t_WbC if t_WbC is not None else None
Does the coding look okay? I know I need to add two columns to the
database, but what else would need to be updated to get the results in the
database?
Rich
--
You received this message because you are subscribed to the Google Groups
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-development/0e328c83-7614-4448-8dd9-743929495d9bo%40googlegroups.com.