Move parameter derivation to SoundingParameters
This commit is contained in:
parent
5b33653dcf
commit
e5f00ee85f
1 changed files with 10 additions and 9 deletions
|
@ -1,6 +1,8 @@
|
|||
import datetime
|
||||
import shapely
|
||||
|
||||
from typing import Self
|
||||
|
||||
from xmet.db import Database, DatabaseTable, DatabaseOrder
|
||||
from xmet.coord import COORD_SYSTEM
|
||||
from xmet.list import nearest
|
||||
|
@ -47,9 +49,6 @@ class SoundingSample(DatabaseTable):
|
|||
def is_saturated(self) -> bool:
|
||||
return self.humidity >= 100.0
|
||||
|
||||
class SoundingParameters():
|
||||
pass
|
||||
|
||||
class Sounding(DatabaseTable):
|
||||
__slots__ = (
|
||||
'id', 'station', 'timestamp_observed', 'timestamp_released',
|
||||
|
@ -185,13 +184,15 @@ class Sounding(DatabaseTable):
|
|||
|
||||
return series
|
||||
|
||||
def derive_parameters(self) -> SoundingParameters:
|
||||
temp_line = self.follow_temp()
|
||||
dry_adiabat = follow_dry_adiabat(self.samples[0].temp,
|
||||
self.samples[0].pressure)
|
||||
class SoundingParameters():
|
||||
@staticmethod
|
||||
def from_sounding(sounding: Sounding) -> Self:
|
||||
temp_line = sounding.follow_temp()
|
||||
dry_adiabat = follow_dry_adiabat(sounding.samples[0].temp,
|
||||
sounding.samples[0].pressure)
|
||||
|
||||
saturated_mr_line = follow_saturated_mixing_ratio(self.samples[0].dewpoint,
|
||||
self.samples[0].pressure)
|
||||
saturated_mr_line = follow_saturated_mixing_ratio(sounding.samples[0].dewpoint,
|
||||
sounding.samples[0].pressure)
|
||||
|
||||
lcl = dry_adiabat.intersect(saturated_mr_line, SeriesIntersection.LESSER)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue