Allow full parsing of Current.rawins from UCAR

This commit is contained in:
XANTRONIX 2025-03-28 19:49:47 -04:00
parent 9bde5a77a0
commit ae57b24954

View file

@ -46,6 +46,9 @@ class RAOBSounding():
def finish(self) -> Sounding:
timestamp = self.parse_timestamp(self.timestamp)
if timestamp is None:
return
sounding = Sounding()
sounding.samples = list()
sounding.station = self.station
@ -519,6 +522,9 @@ class RAOBReader():
for data in samples:
pressure = data['pressure']
if pressure is None:
continue
sounding.record_height(pressure, data.get('height'))
sounding.record_temp_dewpoint(pressure,
@ -530,7 +536,10 @@ class RAOBReader():
data.get('wind_dir'))
for key in self.soundings:
yield self.soundings[key].finish()
sounding = self.soundings[key].finish()
if sounding is not None:
yield sounding
@staticmethod
def each_sounding_from_fh(fh: io.TextIOBase):