[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[python #LQP-512213]: MetPy CCL Calculation Options



Hi, and thanks for reaching out!

MetPy provides functionality for identifying the most unstable parcel in a 
given profile, across some layer depth (defaults to 300-hPa.) The documentation 
for that is available here: 
https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.most_unstable_parcel.html.
 You can combine these two functions to calculate the CCL from the most 
unstable parcel, for example,

    from metpy.calc import ccl, most_unstable_parcel
    from metpy.units import units
    
    pressure = [993, 957, 925, 886, 850, 813, 798, 732, 716, 700] * units.mbar
    temperature = [34.6, 31.1, 27.8, 24.3, 21.4, 19.6, 18.7, 13, 13.5, 13] * 
units.degC
    dewpoint = [19.6, 18.7, 17.8, 16.3, 12.4, -0.4, -3.8, -6, -13.2, -11] * 
units.degC
    
    _, _, _, ind = most_unstable_parcel(pressure, temperature, dewpoint)
    
    most_unstable_ccl = ccl(pressure[ind:], temperature[ind:], dewpoint[ind:])

where `ind` is the index of our most unstable parcel in the original profile. 
You can also get the most unstable parcel pressure, temperature, and dewpoint 
from that function as well.

I'm not familiar with "forecast surface parcel" here. You can manually replace 
or insert values into your sounding if you have some forecast data to blend, 
and pass that into CCL the same as any other profile. If you have any specific 
example or sample data here, let me know! I hope this helps.


All the best,

Drew


> I understand that this code can be used to calculate the CCL for a 
> surface-based parcel or mixed layer parcel.
> 
> Using this script, is there a way to calculate the CCL using a forecast 
> surface parcel and most unstable parcel?
> 


Ticket Details
===================
Ticket ID: LQP-512213
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with NSF Unidata User Support are recorded in the 
Unidata inquiry tracking system and then made publicly available through the 
web.  If you do not want to have your interactions made available in this way, 
you must let us know in each email you send to us.