Only follow temperature line once
This commit is contained in:
parent
5f55060b09
commit
830425980d
1 changed files with 5 additions and 6 deletions
|
@ -185,9 +185,8 @@ class Sounding(DatabaseTable):
|
|||
|
||||
return series
|
||||
|
||||
def find_lfc(self, temp: float, pressure: float) -> tuple[float]:
|
||||
def find_lfc(self, temp: float, pressure: float, temp_line: Series) -> tuple[float]:
|
||||
moist_adiabat = follow_moist_adiabat(temp, pressure)
|
||||
temp_line = self.follow_temp()
|
||||
|
||||
pairs = nearest(sorted(moist_adiabat.keys(), reverse=True),
|
||||
sorted(temp_line.keys(), reverse=True))
|
||||
|
@ -198,9 +197,8 @@ class Sounding(DatabaseTable):
|
|||
if v1 > v2:
|
||||
return v1, pair[0]
|
||||
|
||||
def find_el(self, temp: float, pressure: float) -> tuple[float]:
|
||||
def find_el(self, temp: float, pressure: float, temp_line: Series) -> tuple[float]:
|
||||
moist_adiabat = follow_moist_adiabat(temp, pressure)
|
||||
temp_line = self.follow_temp()
|
||||
|
||||
pairs = nearest(sorted(moist_adiabat.keys(), reverse=True),
|
||||
sorted(temp_line.keys(), reverse=True))
|
||||
|
@ -212,6 +210,7 @@ class Sounding(DatabaseTable):
|
|||
return v1, pair[0]
|
||||
|
||||
def derive_parameters(self) -> SoundingParameters:
|
||||
temp_line = self.follow_temp()
|
||||
dry_adiabat = follow_dry_adiabat(self.samples[0].temp,
|
||||
self.samples[0].pressure)
|
||||
|
||||
|
@ -219,8 +218,8 @@ class Sounding(DatabaseTable):
|
|||
self.samples[0].pressure)
|
||||
|
||||
lcl = dry_adiabat.intersect(saturated_mr_line, SeriesIntersection.LESSER)
|
||||
lfc = self.find_lfc(lcl[0], lcl[1])
|
||||
el = self.find_el(lfc[0], lfc[1])
|
||||
lfc = self.find_lfc(lcl[0], lcl[1], temp_line)
|
||||
el = self.find_el(lfc[0], lfc[1], temp_line)
|
||||
|
||||
params = SoundingParameters()
|
||||
params.lcl = lcl
|
||||
|
|
Loading…
Add table
Reference in a new issue