cape_cin#
- metpy.calc.cape_cin(pressure, temperature, dewpoint, parcel_profile, which_lfc='bottom', which_el='top')#
Calculate CAPE and CIN.
Calculate the convective available potential energy (CAPE) and convective inhibition (CIN) of a given upper air profile and parcel path. CIN is integrated between the surface and LFC, CAPE is integrated between the LFC and EL (or top of sounding). Intersection points of the measured temperature profile and parcel profile are logarithmically interpolated.
- Parameters
pressure (
pint.Quantity
) – Atmospheric pressure level(s) of interest, in order from highest to lowest pressuretemperature (
pint.Quantity
) – Atmospheric temperature corresponding to pressuredewpoint (
pint.Quantity
) – Atmospheric dewpoint corresponding to pressureparcel_profile (
pint.Quantity
) – Temperature profile of the parcelwhich_lfc (str) – Choose which LFC to integrate from. Valid options are ‘top’, ‘bottom’, ‘wide’, and ‘most_cape’. Default is ‘bottom’.
which_el (str) – Choose which EL to integrate to. Valid options are ‘top’, ‘bottom’, ‘wide’, and ‘most_cape’. Default is ‘top’.
- Returns
pint.Quantity
– Convective Available Potential Energy (CAPE)pint.Quantity
– Convective Inhibition (CIN)
Notes
Formula adopted from [Hobbs1977].
\[\text{CAPE} = -R_d \int_{LFC}^{EL} (T_{parcel} - T_{env}) d\text{ln}(p)\]\[\text{CIN} = -R_d \int_{SFC}^{LFC} (T_{parcel} - T_{env}) d\text{ln}(p)\]\(CAPE\) is convective available potential energy
\(CIN\) is convective inhibition
\(LFC\) is pressure of the level of free convection
\(EL\) is pressure of the equilibrium level
\(SFC\) is the level of the surface or beginning of parcel path
\(R_d\) is the gas constant
\(g\) is gravitational acceleration
\(T_{parcel}\) is the parcel temperature
\(T_{env}\) is environment temperature
\(p\) is atmospheric pressure
Only functions on 1D profiles (not higher-dimension vertical cross sections or grids). Since this function returns scalar values when given a profile, this will return Pint Quantities even when given xarray DataArray profiles.
Changed in version 1.0: Renamed
dewpt
parameter todewpoint