Redo Sounding.find_el() with Series.intersect()

This commit is contained in:
XANTRONIX 2025-03-09 12:36:14 -04:00
parent 68880816ac
commit 6faef30524

View file

@ -185,11 +185,6 @@ class Sounding(DatabaseTable):
return series
def find_el(self, temp: float, pressure: float, temp_line: Series) -> tuple[float]:
moist_adiabat = follow_moist_adiabat(temp, pressure)
return moist_adiabat.intersect(temp_line, SeriesIntersection.LESSER)
def derive_parameters(self) -> SoundingParameters:
temp_line = self.follow_temp()
dry_adiabat = follow_dry_adiabat(self.samples[0].temp,
@ -203,7 +198,7 @@ class Sounding(DatabaseTable):
moist_adiabat = follow_moist_adiabat(*lcl)
lfc = moist_adiabat.intersect(temp_line, SeriesIntersection.GREATER)
el = self.find_el(lfc[0], lfc[1], temp_line)
el = moist_adiabat.intersect(temp_line, SeriesIntersection.LESSER, lfc[1])
params = SoundingParameters()
params.lcl = lcl