Fill out other Sounding attributes
This commit is contained in:
parent
6e13729a8c
commit
55b7cfb819
1 changed files with 12 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue