From 76e604490f6de011eddf7af32a000179e70fd3c1 Mon Sep 17 00:00:00 2001 From: Alan Mitchell Date: Sun, 1 Mar 2020 18:07:34 -0900 Subject: [PATCH] Added NWS Dewpoint temperature as a calculated function. --- bmsapp/calcs/calcfuncs01.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bmsapp/calcs/calcfuncs01.py b/bmsapp/calcs/calcfuncs01.py index 7c04ddd..86b0ea4 100644 --- a/bmsapp/calcs/calcfuncs01.py +++ b/bmsapp/calcs/calcfuncs01.py @@ -98,6 +98,18 @@ class CalcReadingFuncs_01(calcreadings.CalcReadingFuncs_base): # not info info available for calculation. return [], [] + def getInternetDewpoint(self, stnCode): + """** No parameters are sensor reading arrays ** + + Returns an outdoor Dewpoint temperature from an NWS weather station in degrees F. + Returns just one record of information, timestamped with the current time. + """ + obs = internetwx.getWeatherObservation(stnCode) + if obs.dewpt is not None: + return [int(time.time())], [obs.dewpt.value() * 1.8 + 32.0] + else: + return [], [] + def getWUtemperature(self, stn, stn2=None): """** No parameters are sensor reading arrays ** -- 2.26.2