Ensure samples are added to Sounding.samples list
This commit is contained in:
parent
082e201ad8
commit
322c7fa6bb
2 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue