diff --git a/lib/xmet/bufr.py b/lib/xmet/bufr.py index 7c2d25b..bd9badd 100644 --- a/lib/xmet/bufr.py +++ b/lib/xmet/bufr.py @@ -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 diff --git a/lib/xmet/sounding.py b/lib/xmet/sounding.py index ea1f192..a45a95b 100644 --- a/lib/xmet/sounding.py +++ b/lib/xmet/sounding.py @@ -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,