From 74678d6a32921d5aa36a463a61d95736e8b11261 Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Sun, 9 Mar 2025 12:15:24 -0400 Subject: [PATCH] Redo Sounding.find_el() with Series.intersect() --- lib/xmet/sounding.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/xmet/sounding.py b/lib/xmet/sounding.py index 12a2684..b40eca8 100644 --- a/lib/xmet/sounding.py +++ b/lib/xmet/sounding.py @@ -200,14 +200,7 @@ class Sounding(DatabaseTable): def find_el(self, temp: float, pressure: float, temp_line: Series) -> tuple[float]: moist_adiabat = follow_moist_adiabat(temp, pressure) - pairs = nearest(sorted(moist_adiabat.keys(), reverse=True), - sorted(temp_line.keys(), reverse=True)) - - for pair in pairs: - v1, v2 = moist_adiabat[pair[0]], temp_line[pair[1]] - - if v1 < v2: - return v1, pair[0] + return moist_adiabat.intersect(temp_line, SeriesIntersection.LESSER) def derive_parameters(self) -> SoundingParameters: temp_line = self.follow_temp()