From 8e483e1325e8999d432a58e41aae94d6a5935472 Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Sat, 15 Mar 2025 00:59:28 -0400 Subject: [PATCH] Calculations are getting there --- lib/xmet/sounding.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/xmet/sounding.py b/lib/xmet/sounding.py index a1030f9..a98549f 100644 --- a/lib/xmet/sounding.py +++ b/lib/xmet/sounding.py @@ -250,9 +250,11 @@ class SoundingParams(): surface.dewpoint, surface.pressure) - temp_line = sounding.follow_temp() - dewpoint_line = sounding.follow_dewpoint() - dry_adiabat = follow_dry_adiabat(tv, surface.pressure) + temp_line = sounding.follow_temp() + dewpoint_line = sounding.follow_dewpoint() + virtual_temp_line = sounding.follow_virtual_temp() + + dry_adiabat = follow_dry_adiabat(surface.temp, surface.pressure) mixing_ratio_line = follow_saturated_mixing_ratio(surface.dewpoint, surface.pressure) @@ -266,15 +268,20 @@ class SoundingParams(): moist_adiabat = follow_moist_adiabat(tv2, lcl[1]) - lfc = moist_adiabat.intersect(temp_line, SeriesIntersection.GREATER) + lfc = moist_adiabat.intersect(virtual_temp_line, + SeriesIntersection.GREATER) - el = temp_line.intersect(moist_adiabat, SeriesIntersection.GREATER, + el = temp_line.intersect(moist_adiabat, + SeriesIntersection.GREATER, lfc[1]) self.lcl = lcl self.lfc = lfc self.el = el - self.cape = SoundingParams.cape(temp_line, moist_adiabat, lfc, el) + self.cape = SoundingParams.cape(virtual_temp_line, + moist_adiabat, + lfc, + el) self.temp_line = temp_line self.dry_adiabat = dry_adiabat