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 datetime
import shapely
from typing import Self from typing import Self
@ -54,11 +55,18 @@ class BUFRSounding(Sounding):
sounding = BUFRSounding() sounding = BUFRSounding()
geom = response[0].getGeometry()
dt = response[0].getDataTime() dt = response[0].getDataTime()
epoch = dt.getRefTime().time / 1000.0 epoch = dt.getRefTime().time / 1000.0
timestamp = datetime.datetime.fromtimestamp(epoch, datetime.UTC)
sounding.timestamp_observed = datetime.datetime.fromtimestamp(epoch, sounding.station = station
datetime.UTC) 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: for item in response:
params = item.getParameters() params = item.getParameters()