Fill out other Sounding attributes

This commit is contained in:
XANTRONIX 2025-04-13 14:52:05 -04:00
parent 6e13729a8c
commit 55b7cfb819

View file

@ -1,4 +1,5 @@
import datetime
import shapely
from typing import Self
@ -54,11 +55,18 @@ class BUFRSounding(Sounding):
sounding = BUFRSounding()
dt = response[0].getDataTime()
epoch = dt.getRefTime().time / 1000.0
geom = response[0].getGeometry()
dt = response[0].getDataTime()
epoch = dt.getRefTime().time / 1000.0
timestamp = datetime.datetime.fromtimestamp(epoch, datetime.UTC)
sounding.timestamp_observed = datetime.datetime.fromtimestamp(epoch,
datetime.UTC)
sounding.station = station
sounding.data_source_pressure = 'UCAR'
sounding.data_source_other = 'UCAR'
sounding.location = shapely.Point(geom.x, geom.y)
sounding.timestamp_observed = timestamp
sounding.timestamp_released = timestamp - datetime.timedelta(minutes=45)
for item in response:
params = item.getParameters()