From ce93b5e7b11ba3a6efcbc64285873808e84bcc00 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development <dev@xantronix.com> Date: Thu, 13 Mar 2025 00:48:10 -0400 Subject: [PATCH] Use a constant factor --- lib/xmet/thermo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/xmet/thermo.py b/lib/xmet/thermo.py index 94aaedd..cbed4cd 100644 --- a/lib/xmet/thermo.py +++ b/lib/xmet/thermo.py @@ -73,7 +73,9 @@ def pressure_height(pressure: float, surface: float=PRESSURE_MSL) -> float: Return the approximate altitude, in meters, for a given pressure in millibar. """ - return (1 - (pressure / surface) ** 0.190284) * 145366.45 * 0.3107596 + factor = 1.0195528177497388 + + return (1 - (pressure / surface) ** 0.190284) * 145366.45 * 0.3048 * factor def lapse(temp: float, delta: float, rate=LAPSE_RATE_DRY) -> float: """