- metpy.calc.ccl(pressure, temperature, dewpoint, height=None, mixed_layer_depth=None, which='top')#
Calculate the convective condensation level (CCL) and convective temperature.
This function is implemented directly based on the definition of the CCL, as in [USAF1990], and finding where the ambient temperature profile intersects the line of constant mixing ratio starting at the surface, using the surface dewpoint or the average dewpoint of a shallow layer near the surface.
pint.Quantity) – Atmospheric pressure profile
pint.Quantity) – Temperature at the levels given by pressure
pint.Quantity) – Dewpoint at the levels given by pressure
pint.Quantity, optional) – Atmospheric heights at the levels given by pressure. Only needed when specifying a mixed layer depth as a height.
pint.Quantity, optional) – The thickness of the mixed layer as a pressure or height above the bottom of the layer (default None).
which (str, optional) – Pick which CCL value to return; must be one of ‘top’, ‘bottom’, or ‘all’. ‘top’ returns the lowest-pressure CCL (default), ‘bottom’ returns the highest-pressure CCL, ‘all’ returns every CCL in a Pint.Quantity array.
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.
>>> import metpy.calc as mpcalc >>> 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 >>> ccl_p, ccl_t, t_c = mpcalc.ccl(pressure, temperature, dewpoint) >>> ccl_p, t_c (<Quantity(758.348093, 'millibar')>, <Quantity(38.4336274, 'degree_Celsius')>)