From 9de6ac0d56fbb7596c805d8aae565832a1b743fb Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Fri, 7 Mar 2025 14:50:05 -0500 Subject: [PATCH] Fix docstring --- lib/xmet/thermo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/xmet/thermo.py b/lib/xmet/thermo.py index 7df6954..c382794 100644 --- a/lib/xmet/thermo.py +++ b/lib/xmet/thermo.py @@ -49,8 +49,9 @@ def saturated_mixing_ratio(temp: float, pressure: float) -> float: def mixing_ratio_temp(ratio: float, pressure: float) -> float: """ - Return the temperature, in degrees celsius, of a given mixing ratio at a - specified pressure, in millibar. + Return the temperature, in degrees celsius, of a given mixing ratio of + kilograms of moisture to kilograms of air, at a specified pressure, in + millibar. """ c1 = 0.0498646455 c2 = 2.4082965 @@ -59,7 +60,8 @@ def mixing_ratio_temp(ratio: float, pressure: float) -> float: c5 = 0.0915 c6 = 1.2035 - x = math.log10(ratio * pressure / (622.0 + ratio)) + w = ratio * 1000.0 + x = math.log10(w * pressure / (622.0 + w)) return celsius(math.pow(10.0, ((c1 * x) + c2)) - c3 + \ (c4 * math.pow((math.pow(10, (c5 * x)) - c6), 2)))