Implement parsing for 700mb level

This commit is contained in:
XANTRONIX 2025-03-02 20:56:37 -05:00
parent bfc3d87d73
commit e5cbb9675a

View file

@ -111,26 +111,32 @@ class RAOBObs():
return None return None
def calc_1000mb_height(self, height: float) -> float: def calc_1000mb_height(self, value: float) -> float:
if height >= 500: if value >= 500:
return 0 - (height - 500) return 0 - (value - 500)
return height return value
def calc_850mb_height(self, height: float) -> float: def calc_850mb_height(self, value: float) -> float:
return 1000.0 + height return 1000.0 + value
def calc_500mb_height(self, height: float) -> float: def calc_700mb_height(self, value: float) -> float:
return 10.0 * height if value >= 500:
return 2000.0 + value
def calc_250mb_height(self, height: float) -> float:
if height >= 500:
return height * 10
else: else:
return 10.0 * (1000.0 + height) return 3000.0 + value
def calc_100mb_height(self, height: float) -> float: def calc_500mb_height(self, value: float) -> float:
return 10.0 * (1000.0 + height) 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): def parse_height_pressure(self, token: str):
code = token[0:2] code = token[0:2]
@ -154,8 +160,10 @@ class RAOBObs():
return None return None
elif pressure == 1000: elif pressure == 1000:
height = self.calc_1000mb_height(float(num)) 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)) 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: elif pressure <= 500 and pressure > 250:
height = self.calc_500mb_height(float(num)) height = self.calc_500mb_height(float(num))
elif pressure <= 250 and pressure > 100: elif pressure <= 250 and pressure > 100: