From 3a8f5ae850ceff80dd6192d4cf17172800983421 Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Sun, 2 Mar 2025 17:06:56 -0500 Subject: [PATCH] Add wrapper functions to RAOBReader --- lib/xmet/raob.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/xmet/raob.py b/lib/xmet/raob.py index d8abb28..c1b27fe 100644 --- a/lib/xmet/raob.py +++ b/lib/xmet/raob.py @@ -379,3 +379,14 @@ class RAOBReader(): def each_sounding(self): for chunk in self.each_chunk(): yield from chunk.each_sounding() + + @staticmethod + def each_sounding_from_fh(fh: io.TextIOBase): + reader = RAOBReader(fh) + + yield from reader.each_sounding() + + @staticmethod + def each_sounding_from_file(path: str): + with open(path, 'r') as fh: + yield from RAOBReader.each_sounding_from_fh(fh)