From b45a6f27c528dba702f8af9fd3bbcfa958a2bbb3 Mon Sep 17 00:00:00 2001
From: XANTRONIX Industrial <xan@xantronix.com>
Date: Tue, 4 Mar 2025 23:21:18 -0500
Subject: [PATCH] Allow providing lapse rate argument

---
 lib/xmet/thermo.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/xmet/thermo.py b/lib/xmet/thermo.py
index f8c2c62..cfefcac 100644
--- a/lib/xmet/thermo.py
+++ b/lib/xmet/thermo.py
@@ -50,9 +50,9 @@ def pressure_height(pressure: float) -> float:
     """
     return (1 - (pressure / 1013.25) ** 0.190284) * 145366.45 * 0.3048
 
-def lapse(temp: float, delta: float) -> float:
+def lapse(temp: float, delta: float, rate=LAPSE_RATE_DRY) -> float:
     """
     Return the temperature of a parcel cooled at the dry lapse rate for a
     given increase in height (in meters).
     """
-    return temp - (LAPSE_RATE_DRY * delta)
+    return temp - (rate * delta)