Redo Sounding.find_lcl() with Series.intersect()
This commit is contained in:
parent
74678d6a32
commit
2edea01934
1 changed files with 1 additions and 8 deletions
|
@ -188,14 +188,7 @@ class Sounding(DatabaseTable):
|
||||||
def find_lfc(self, temp: float, pressure: float, temp_line: Series) -> tuple[float]:
|
def find_lfc(self, temp: float, pressure: float, temp_line: Series) -> tuple[float]:
|
||||||
moist_adiabat = follow_moist_adiabat(temp, pressure)
|
moist_adiabat = follow_moist_adiabat(temp, pressure)
|
||||||
|
|
||||||
pairs = nearest(sorted(moist_adiabat.keys(), reverse=True),
|
return moist_adiabat.intersect(temp_line, SeriesIntersection.GREATER)
|
||||||
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]
|
|
||||||
|
|
||||||
def find_el(self, temp: float, pressure: float, temp_line: Series) -> tuple[float]:
|
def find_el(self, temp: float, pressure: float, temp_line: Series) -> tuple[float]:
|
||||||
moist_adiabat = follow_moist_adiabat(temp, pressure)
|
moist_adiabat = follow_moist_adiabat(temp, pressure)
|
||||||
|
|
Loading…
Add table
Reference in a new issue