From e5cbb9675a31597fa5fe6626869a3bda40040110 Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Sun, 2 Mar 2025 20:56:37 -0500 Subject: [PATCH] Implement parsing for 700mb level --- lib/xmet/raob.py | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/lib/xmet/raob.py b/lib/xmet/raob.py index 9ad1921..f081b31 100644 --- a/lib/xmet/raob.py +++ b/lib/xmet/raob.py @@ -111,26 +111,32 @@ class RAOBObs(): return None - def calc_1000mb_height(self, height: float) -> float: - if height >= 500: - return 0 - (height - 500) + def calc_1000mb_height(self, value: float) -> float: + if value >= 500: + return 0 - (value - 500) - return height + return value - def calc_850mb_height(self, height: float) -> float: - return 1000.0 + height + def calc_850mb_height(self, value: float) -> float: + return 1000.0 + value - def calc_500mb_height(self, height: float) -> float: - return 10.0 * height - - def calc_250mb_height(self, height: float) -> float: - if height >= 500: - return height * 10 + def calc_700mb_height(self, value: float) -> float: + if value >= 500: + return 2000.0 + value else: - return 10.0 * (1000.0 + height) + return 3000.0 + value - def calc_100mb_height(self, height: float) -> float: - return 10.0 * (1000.0 + height) + def calc_500mb_height(self, value: float) -> float: + return 10.0 * value + + def calc_250mb_height(self, value: float) -> float: + if value >= 500: + return value * 10 + else: + return 10.0 * (1000.0 + value) + + def calc_100mb_height(self, value: float) -> float: + return 10.0 * (1000.0 + value) def parse_height_pressure(self, token: str): code = token[0:2] @@ -154,8 +160,10 @@ class RAOBObs(): return None elif pressure == 1000: height = self.calc_1000mb_height(float(num)) - elif pressure <= 850 and pressure > 500: + elif pressure <= 850 and pressure > 700: height = self.calc_850mb_height(float(num)) + elif pressure <= 700 and pressure > 500: + height = self.calc_700mb_height(float(num)) elif pressure <= 500 and pressure > 250: height = self.calc_500mb_height(float(num)) elif pressure <= 250 and pressure > 100: