X-Git-Url: https://wylark.com/src/infoex-autowx.git/blobdiff_plain/992a343b1c78aeaa23c2d481f7f8655e11f777bf..3c82e8fc137b0eacf34792e84e3ae5775538a5df:/infoex-autowx.py?ds=inline diff --git a/infoex-autowx.py b/infoex-autowx.py index 87c9c4a..f059394 100755 --- a/infoex-autowx.py +++ b/infoex-autowx.py @@ -43,7 +43,7 @@ import zeep import zeep.cache import zeep.transports -__version__ = '3.3.0' +__version__ = '3.3.1' LOG = logging.getLogger(__name__) LOG.setLevel(logging.NOTSET) @@ -627,7 +627,20 @@ def get_mesowest_data(begin, end, station): remote_data[element_cd] = None if len(hn24_values) > 0: - hn24 = max(hn24_values) - min(hn24_values) + # instead of taking MAX - MIN, we want the first value (most + # distant) - the last value (most recent) + # + # if the result is positive, then we have HN24; if it's not, + # then we have settlement + #hn24 = max(hn24_values) - min(hn24_values) + hn24 = hn24_values[0] - hn24_values[len(hn24_values)-1] + + if hn24 < 0.0: + # this case represents HS settlement + # + # TODO: determine if InfoEx supports auto-stations reporting + # HS settlement values + hn24 = 0.0 if len(wind_speed_values) > 0: wind_speed_avg = sum(wind_speed_values) / len(wind_speed_values)