From d0cb897725cf04981a90c6634c1b235770c30c93 Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Wed, 16 Apr 2025 11:17:50 -0400 Subject: [PATCH] Move magic value into class variable --- lib/xmet/bufr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/xmet/bufr.py b/lib/xmet/bufr.py index 25099fb..2e78b39 100644 --- a/lib/xmet/bufr.py +++ b/lib/xmet/bufr.py @@ -11,6 +11,8 @@ from xmet.units import celsius class BUFRSounding(Sounding): EDEX_HOST = 'edex-cloud.unidata.ucar.edu' + BUFR_SOURCE = 'UCAR' + BUFR_TYPE = 'bufrua' BUFR_PARAMS_MAN = set(['prMan', 'htMan', 'wdMan', 'wsMan']) BUFR_PARAMS_SIGT = set(['prSigT', 'htSigT', 'tpSigT', 'tdSigT']) @@ -108,8 +110,8 @@ class BUFRSounding(Sounding): timestamp = datetime.datetime.fromtimestamp(epoch, datetime.UTC) sounding.station = response[0].getLocationName() - sounding.data_source_pressure = 'UCAR' - sounding.data_source_other = 'UCAR' + sounding.data_source_pressure = BUFRSounding.BUFR_SOURCE + sounding.data_source_other = BUFRSounding.BUFR_SOURCE sounding.location = shapely.Point(geom.x, geom.y) sounding.timestamp_observed = timestamp