Redo Sounding.find_el() with Series.intersect()
This commit is contained in:
		
							parent
							
								
									830425980d
								
							
						
					
					
						commit
						74678d6a32
					
				
					 1 changed files with 1 additions and 8 deletions
				
			
		|  | @ -200,14 +200,7 @@ class Sounding(DatabaseTable): | ||||||
|     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) | ||||||
| 
 | 
 | ||||||
|         pairs = nearest(sorted(moist_adiabat.keys(), reverse=True), |         return moist_adiabat.intersect(temp_line, SeriesIntersection.LESSER) | ||||||
|                         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 derive_parameters(self) -> SoundingParameters: |     def derive_parameters(self) -> SoundingParameters: | ||||||
|         temp_line   = self.follow_temp() |         temp_line   = self.follow_temp() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue