Ensure samples are added to Sounding.samples list

This commit is contained in:
XANTRONIX 2025-04-13 10:57:32 -04:00
parent 082e201ad8
commit 322c7fa6bb
2 changed files with 9 additions and 2 deletions

View file

@ -22,9 +22,12 @@ class BUFRSounding(Sounding):
sample = self.samples_by_pressure.get(pressure)
if sample is None:
self.samples_by_pressure[pressure] = SoundingSample()
sample = SoundingSample()
sample.pressure = pressure
return self.samples_by_pressure[pressure]
self.samples_by_pressure[pressure] = sample
return sample
@staticmethod
def init():
@ -76,4 +79,7 @@ class BUFRSounding(Sounding):
sample.wind_speed = item.getNumber('wsSigW')
sample.wind_dir = item.getNumber('wdSigW')
for pressure in sorted(sounding.samples_by_pressure.keys(), reverse=True):
sounding.samples.append(sounding.samples_by_pressure[pressure])
return sounding

View file

@ -131,6 +131,7 @@ class Sounding(DatabaseTable):
super().__init__()
self.id = None
self.location = None
self.samples = list()
@staticmethod
def valid_by_station(db: Database,