sharppy / SHARPpy

Sounding/Hodograph Analysis and Research Program in Python
https://sharppy.github.io/SHARPpy/index.html
Other
216 stars 112 forks source link

CAPE Method Calculation Error #239

Open aarande opened 2 years ago

aarande commented 2 years ago

I was made aware of an error in CAPE values in my application and after some investigation found a problem with the cape method in params when compared to the parcelx method.

In my application I use the cape method to get the amount of CAPE in the mixed layer parcel for the layer between -10C and -30C. After updating to version 1.4.0 code it was reported these values were much larger than expected. According to my understanding and the docs the cape method is the same as the parcelx but only calculates a limited number of variables for speed. So calling cape and parcelx for the same parcel and layer should return the same values. The cape method is returning much larger values closer to the overall bplus value for the parcel while the parcelx method appears to return bplus values that make more sense for the limited layer. Here are two calls that can be run for any sounding to demonstrate the values are different but should not be.

hailpcl = tab.params.cape(profile, profile.mlpcl.pm10c, profile.mlpcl.pm30c, flag=4) print("Using CAPE method value is {}".format(hailpcl.bplus)

hailpcl = tab.params.parcelx(profile, profile.mlpcl.pm10c, profile.mlpcl.pm30c, flag=4) print("Using parcelx method value is {}".format(hailpcl.bplus)

Thanks, Aaron