From 55b7cfb819c8f23c9e64028062b676342394fa9b Mon Sep 17 00:00:00 2001
From: XANTRONIX Industrial <xan@xantronix.com>
Date: Sun, 13 Apr 2025 14:52:05 -0400
Subject: [PATCH] Fill out other Sounding attributes

---
 lib/xmet/bufr.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lib/xmet/bufr.py b/lib/xmet/bufr.py
index 5b07be7..35af234 100644
--- a/lib/xmet/bufr.py
+++ b/lib/xmet/bufr.py
@@ -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()