Add convenience generators to loop over soundings

This commit is contained in:
XANTRONIX 2025-03-01 14:17:00 -05:00
parent 4b5b69ca21
commit d51c61dd5e

View file

@ -216,6 +216,16 @@ class RawinsChunk():
if obs is not None:
yield obs
def each_sounding(self):
for obs in self.each_obs():
if obs.kind == 'TTAA':
sounding = obs.parse_ttaa()
if sounding is None or len(sounding.samples) == 0:
continue
yield sounding
class RawinsReader():
"""
A reader for the global `Current.rawins` file provided by UCAR:
@ -297,3 +307,7 @@ class RawinsReader():
def each_obs(self):
for chunk in self.each_chunk():
yield from chunk.each_obs()
def each_sounding(self):
for chunk in self.each_chunk():
yield from chunk.each_sounding()