Progress
This commit is contained in:
parent
1bf5f3eabe
commit
4f0c11cfca
1 changed files with 12 additions and 4 deletions
|
@ -1,8 +1,8 @@
|
||||||
import datetime
|
import datetime
|
||||||
import shapely
|
import shapely
|
||||||
|
|
||||||
LAPSE_RATE_DRY = 9.8 / 1000 # degrees C per 1000m
|
LAPSE_RATE_DRY = 9.8 # degrees C per 1000m
|
||||||
LAPSE_RATE_MOIST = 4.0 / 1000
|
LAPSE_RATE_MOIST = 4.0
|
||||||
|
|
||||||
class SoundingSample():
|
class SoundingSample():
|
||||||
__slots__ = (
|
__slots__ = (
|
||||||
|
@ -45,12 +45,20 @@ class SoundingSample():
|
||||||
|
|
||||||
return 621.97 * (es / (self.pressure - es))
|
return 621.97 * (es / (self.pressure - es))
|
||||||
|
|
||||||
def lcl(self) -> float:
|
def lcl(self) -> float: # meters
|
||||||
return (self.temperature - self.dewpoint) / 8.0
|
return (self.temp - self.dewpoint) / 0.008
|
||||||
|
|
||||||
def is_saturated(self) -> bool:
|
def is_saturated(self) -> bool:
|
||||||
return self.humidity >= 100.0
|
return self.humidity >= 100.0
|
||||||
|
|
||||||
|
def lapse(self, h: float, rate=None) -> float:
|
||||||
|
if rate is None:
|
||||||
|
rate = LAPSE_RATE_MOIST if self.is_saturated() else LAPSE_RATE_DRY
|
||||||
|
|
||||||
|
hd = h - self.height
|
||||||
|
|
||||||
|
return self.temp - (rate * (hd / 1000))
|
||||||
|
|
||||||
class Sounding():
|
class Sounding():
|
||||||
__slots__ = (
|
__slots__ = (
|
||||||
'id', 'station', 'timestamp_observed', 'timestamp_released',
|
'id', 'station', 'timestamp_observed', 'timestamp_released',
|
||||||
|
|
Loading…
Add table
Reference in a new issue