Remove thermodynamic calculations from sounding.py (for now)
This commit is contained in:
		
							parent
							
								
									04e10a17ee
								
							
						
					
					
						commit
						aac34375d7
					
				
					 1 changed files with 0 additions and 34 deletions
				
			
		| 
						 | 
					@ -41,43 +41,9 @@ class SoundingSample(DatabaseTable):
 | 
				
			||||||
        super().__init__()
 | 
					        super().__init__()
 | 
				
			||||||
        self.id = None
 | 
					        self.id = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def vapor_pressure(self) -> float:
 | 
					 | 
				
			||||||
        return 6.11 * 10 * (
 | 
					 | 
				
			||||||
            (7.5 * self.dewpoint) / (237.3 * self.dewpoint)
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def saturated_vapor_pressure(self) -> float:
 | 
					 | 
				
			||||||
        return 6.11 * 10 * (
 | 
					 | 
				
			||||||
            (7.5 * self.temp) / (237.3 * self.temp)
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def mixing_ratio(self) -> float:
 | 
					 | 
				
			||||||
        e = self.vapor_pressure()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return 621.97 * (e / (self.pressure - e))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def saturated_mixing_ratio(self, pressure=None) -> float:
 | 
					 | 
				
			||||||
        if pressure is None:
 | 
					 | 
				
			||||||
            pressure = self.pressure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        es = self.saturated_vapor_pressure()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return 621.97 * (es / (pressure - es))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def lcl(self) -> float: # meters
 | 
					 | 
				
			||||||
        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(DatabaseTable):
 | 
					class Sounding(DatabaseTable):
 | 
				
			||||||
    __slots__ = (
 | 
					    __slots__ = (
 | 
				
			||||||
        'id', 'station', 'timestamp_observed', 'timestamp_released',
 | 
					        'id', 'station', 'timestamp_observed', 'timestamp_released',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue