parcel#

Parcel Lifters#

SHARPlib supports configurable parcel ascent via parcel lifter ‘functors’. These can be passed as arguments to lifting routines in order to compute the desired moist adiabatic ascent.

class nwsspc.sharp.calc.parcel.lifter_wobus(self)#

A functor that calls the Wobus Wetlift for computation of moist adiabats.

This is used to wrap the Wobus Wetlift function for parcel lifting routines. Functors – classes with their operator() overloaded – are used so that functions can be passed to templates in a way that the compiler can still optimize, rather than using function pointers or lambdas.

Specifically, this functor is designed to be passed as a template argument to nwsspc.sharp.calc.parcel.Parcel.lift_parcel, so that the method of computing moist adiabats can be changed without changing the overall parcel lifting code. The reason this is awesome is that the compiler can still optimize and inline this code, while the user can configure the parcel lifting algorithm to their specifications.

__call__(self, pres: float, tmpk: float, new_pres: float) float#

Overloads the call operator in order to facilitate parcel lifting.

Parameters:
  • pres (float) – Parcel pressure (Pa)

  • tmpk (float) – Parcel temperature (K)

  • new_pres (float) – Final level of parcel after lift (Pa)

Returns:

The temperature of the lifted parcel (K)

Return type:

float

parcel_virtual_temperature(self, pres: float, tmpk: float) float#

Computes the virtual temperature of the parcel (after saturation).

Parameters:
  • pres (float) – Parcel pressure (Pa)

  • tmpk (float) – Parcel temperature (K)

Returns:

The virtual temperature of the parcel (K)

Return type:

float

class nwsspc.sharp.calc.parcel.lifter_cm1(self)#

Use the CM1 moist lift calculations for adiabatic and pseudoadiabatic parcel ascent.

property converge#

The iterative convergence criteria (K)

property ma_type#

The type of moist adiabat to use, defined by nwsspc.sharp.calc.thermo.adiabat

property pressure_incr#

The pressure increment (Pa) to use for the iterative solver.

__call__(self, pres: float, tmpk: float, new_pres: float) float#

Lifts a parcel moist adiabatically/pseudoadiabatically using nwsspc.sharp.calc.thermo.moist_adiabat_cm1.

Parameters:
  • pres (float) – Parcel pressure (Pa)

  • tmpk (float) – Parcel temperature (K)

  • new_pres (float) – Final level of parcel after lift (Pa)

Returns:

The temperature of the lifted parcel (K)

Return type:

float

parcel_virtual_temperature(self, pres: float, tmpk: float) float#

Computes the virtual temperature of the parcel (after saturation).

Parameters:
  • pres (float) – Parcel pressure (Pa)

  • tmpk (float) – Parcel temperature (K)

Returns:

The virtual temperature of the parcel (K)

Return type:

float

Parcels#

Parcel creation, parcel ascent, and integrated CAPE/CINH.

class nwsspc.sharp.calc.parcel.LPL(*values)#
SFC = 1#

A tag for surface-based parcels.

FCST = 2#

A tag for forecast parcels.

MU = 3#

A tag for most-unstable parcels.

ML = 4#

A tag for mixed-layer parcels.

USR = 5#

A tag for user-defined parcels.

class nwsspc.sharp.calc.parcel.Parcel(self)#
class nwsspc.sharp.calc.parcel.Parcel(self, pressure: float, temperature: float, dewpoint: float, lpl: nwsspc.sharp.calc.parcel.LPL)

Contains information about a Parcel’s starting level and thermodynamic attributes, as well as derived computations, methods for constructing a parcel, and parcel ascent routines.

Overloaded function.

  1. __init__(self) -> None

  2. __init__(self, pressure: float, temperature: float, dewpoint: float, lpl: nwsspc.sharp.calc.parcel.LPL) -> None

Constructor for a Parcel

Parameters:
  • pressure (float) – Parcel initial pressure (Pa)

  • temperature (float) – Parcel initial temperature (K)

  • dewpoint (float) – Parcel initial dewpoint (K)

  • lpl (nwsspc.sharp.calc.parcel.LPL) – Parcel Lifted Parcel Level (LPL) definition

property pres#

Parcel starting pressure (Pa)

property tmpk#

Parcel starting temperature (K)

property dwpk#

Parcel starting dewpoint (K)

property lcl_pressure#

Pressure at the Lifted Condensation Level (Pa)

property lfc_pressure#

Pressure at the Level of Free Convection (Pa)

property eql_pressure#

Pressure at the parcel Equilibrium Level

property mpl_pressure#

Pressure at the Maximum Parcel Level

property cape#

Parcel Convective Available Potential Energy (J/kg) between the LFC and EL

property cinh#

Parcel Convective Inhibition (J/kg) between the LFC and EL

Parcel Definitions#

surface_parcel(pressure: float, temperature: float, dewpoint: float) nwsspc.sharp.calc.parcel.Parcel#

Given input values of surface pressure, temperature, and dewpoint temperature, construct and return a Surface Based Parcel.

Parameters:
  • pressure (float) – Surface pressure (Pa)

  • temperature (float) – Surface temperature (K)

  • dewpoint (float) – Surface dewpoint (K)

Returns:

Parcel with surface values

Return type:

nwsspc.sharp.calc.parcel.Parcel

mixed_layer_parcel(mix_layer: nwsspc.sharp.calc.layer.PressureLayer, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], potential_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], mixing_ratio: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) nwsspc.sharp.calc.parcel.Parcel#
mixed_layer_parcel(mix_layer: nwsspc.sharp.calc.layer.HeightLayer, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], potential_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], mixing_ratio: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) nwsspc.sharp.calc.parcel.Parcel

Overloaded function.

  1. mixed_layer_parcel(mix_layer: nwsspc.sharp.calc.layer.PressureLayer, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], potential_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], mixing_ratio: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> nwsspc.sharp.calc.parcel.Parcel

Given input arrays of pressure, potential temperature, and water vapor mixing ratio, as well as a defined PressureLayer, compute and return a mixed-layer Parcel.

Parameters:
  • mix_layer (nwsspc.sharp.calc.layer.PressureLayer) – PressureLayer over which to compute a mixed-layer parcel

  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile pressure values (Pa)

  • potential_temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile potential temperature (K)

  • mixing_ratio (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile water vapor mixing ratio (unitless)

Returns:

Parcel with mixed layer values

Return type:

nwsspc.sharp.calc.parcel.Parcel

  1. mixed_layer_parcel(mix_layer: nwsspc.sharp.calc.layer.HeightLayer, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], potential_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], mixing_ratio: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> nwsspc.sharp.calc.parcel.Parcel

Given input arrays of pressure, potential temperature, and water vapor mixing ratio, as well as a defined PressureLayer, compute and return a mixed-layer Parcel.

Parameters:
  • mix_layer (nwsspc.sharp.calc.layer.HeightLayer) – HeightLayer over which to compute a mixed-layer parcel

  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile pressure values (Pa)

  • height (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile height values (meters)

  • potential_temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile potential temperature (K)

  • mixing_ratio (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile water vapor mixing ratio (unitless)

Returns:

Parcel with mixed layer values

Return type:

nwsspc.sharp.calc.parcel.Parcel

most_unstable_parcel(layer: nwsspc.sharp.calc.layer.PressureLayer, lifter: nwsspc.sharp.calc.parcel.lifter_cm1, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], virtual_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], dewpoint: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) nwsspc.sharp.calc.parcel.Parcel#
most_unstable_parcel(layer: nwsspc.sharp.calc.layer.HeightLayer, lifter: nwsspc.sharp.calc.parcel.lifter_cm1, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], virtual_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], dewpoint: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) nwsspc.sharp.calc.parcel.Parcel
most_unstable_parcel(layer: nwsspc.sharp.calc.layer.PressureLayer, lifter: nwsspc.sharp.calc.parcel.lifter_wobus, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], virtual_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], dewpoint: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) nwsspc.sharp.calc.parcel.Parcel
most_unstable_parcel(layer: nwsspc.sharp.calc.layer.HeightLayer, lifter: nwsspc.sharp.calc.parcel.lifter_wobus, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], virtual_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], dewpoint: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) nwsspc.sharp.calc.parcel.Parcel

Overloaded function.

  1. most_unstable_parcel(layer: nwsspc.sharp.calc.layer.PressureLayer, lifter: nwsspc.sharp.calc.parcel.lifter_cm1, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], virtual_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], dewpoint: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> nwsspc.sharp.calc.parcel.Parcel

Given input arrays of pressure, height, temperature, virtual temperature, and dewpoint temperature, as well as a defined PressureLayer/HeightLayer and parcel lifter (lifter_wobus or lifter_cm1), find and return the most unstable parcel.

Parameters:
  • layer (nwsspc.sharp.calc.layer.PressureLayer) – PressureLayer for which to search for the Most Unstable Parcel

  • lifter (nwsspc.sharp.calc.parcel.lifter_cm1) – Parcel lifting routine to use for moist ascent

  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile pressure values (Pa)

  • height (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile height values (meters)

  • temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile temperature values (K)

  • virtual_temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile virtual temperature values (K)

  • dewpoint (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile dewpoint values (K)

Returns:

Parcel with most-unstable values

Return type:

nwsspc.sharp.calc.parcel.Parcel

  1. most_unstable_parcel(layer: nwsspc.sharp.calc.layer.HeightLayer, lifter: nwsspc.sharp.calc.parcel.lifter_cm1, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], virtual_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], dewpoint: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> nwsspc.sharp.calc.parcel.Parcel

Given input arrays of pressure, height, temperature, virtual temperature, and dewpoint temperature, as well as a defined PressureLayer/HeightLayer and parcel lifter (lifter_wobus or lifter_cm1), find and return the most unstable parcel.

Parameters:
  • layer (nwsspc.sharp.calc.layer.HeightLayer) – HeightLayer for which to search for the Most Unstable Parcel

  • lifter (nwsspc.sharp.calc.parcel.lifter_cm1) – Parcel lifting routine to use for moist ascent

  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile pressure values (Pa)

  • height (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile height values (meters)

  • temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile temperature values (K)

  • virtual_temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile virtual temperature values (K)

  • dewpoint (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile dewpoint values (K)

Returns:

Parcel with most-unstable values

Return type:

nwsspc.sharp.calc.parcel.Parcel

  1. most_unstable_parcel(layer: nwsspc.sharp.calc.layer.PressureLayer, lifter: nwsspc.sharp.calc.parcel.lifter_wobus, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], virtual_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], dewpoint: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> nwsspc.sharp.calc.parcel.Parcel

Given input arrays of pressure, height, temperature, virtual temperature, and dewpoint temperature, as well as a defined PressureLayer/HeightLayer and parcel lifter (lifter_wobus or lifter_cm1), find and return the most unstable parcel.

Parameters:
  • layer (nwsspc.sharp.calc.layer.PressureLayer) – PressureLayer for which to search for the Most Unstable Parcel

  • lifter (nwsspc.sharp.calc.parcel.lifter_wobus) – Parcel lifting routine to use for moist ascent

  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile pressure values (Pa)

  • height (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile height values (meters)

  • temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile temperature values (K)

  • virtual_temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile virtual temperature values (K)

  • dewpoint (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile dewpoint values (K)

Return type:

nwsspc.sharp.calc.parcel.Parcel

  1. most_unstable_parcel(layer: nwsspc.sharp.calc.layer.HeightLayer, lifter: nwsspc.sharp.calc.parcel.lifter_wobus, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], virtual_temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], dewpoint: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> nwsspc.sharp.calc.parcel.Parcel

Given input arrays of pressure, height, temperature, virtual temperature, and dewpoint temperature, as well as a defined PressureLayer/HeightLayer and parcel lifter (lifter_wobus or lifter_cm1), find and return the most unstable parcel.

Parameters:
  • layer (nwsspc.sharp.calc.layer.HeightLayer) – HeightLayer for which to search for the Most Unstable Parcel

  • lifter (nwsspc.sharp.calc.parcel.lifter_wobus) – Parcel lifting routine to use for moist ascent

  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile pressure values (Pa)

  • height (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile height values (meters)

  • temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile temperature values (K)

  • virtual_temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile virtual temperature values (K)

  • dewpoint (numpy.ndarray[dtype=float32]) – 1D NumPy array of profile dewpoint values (K)

Returns:

Parcel with most-unstable values

Return type:

nwsspc.sharp.calc.parcel.Parcel

Parcel Operations#

lift_parcel(self, lifter: nwsspc.sharp.calc.parcel.lifter_wobus, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) numpy.ndarray[dtype=float32, shape=(*), order='C']#
lift_parcel(self, lifter: nwsspc.sharp.calc.parcel.lifter_cm1, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) numpy.ndarray[dtype=float32, shape=(*), order='C']

Overloaded function.

  1. lift_parcel(self, lifter: nwsspc.sharp.calc.parcel.lifter_wobus, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> numpy.ndarray[dtype=float32, shape=(*), order='C']

Lifts a Parcel dry adiabatically from its LPL to its LCL dry adiabatically, and then moist adiabatically from the LCL to the top of the profile. The moist adiabat used is determined by the type of lifting functor passed to the function (i.e. lifter_wobus or lifter_cm1).

Parameters:
Returns:

A 1D NumPy array of parcel virtual temperature values (K)

Return type:

numpy.ndarray[dtype=float32]

  1. lift_parcel(self, lifter: nwsspc.sharp.calc.parcel.lifter_cm1, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> numpy.ndarray[dtype=float32, shape=(*), order='C']

Lifts a Parcel dry adiabatically from its LPL to its LCL dry adiabatically, and then moist adiabatically from the LCL to the top of the profile. The moist adiabat used is determined by the type of lifting functor passed to the function (i.e. lifter_wobus or lifter_cm1).

Parameters:
  • lifter (nwsspc.sharp.calc.parcel.lifter_cm1) – An instantiated lifter_cm1 functor

  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of Pressure levels for lifting (Pa)

Returns:

A 1D NumPy array of parcel virtual temperature values (K)

Return type:

numpy.ndarray[dtype=float32]

find_lfc_el(self, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], buoyancy: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) tuple[float, float]#

Searches the buoyancy array for the LFC and EL combination that results in the maximum amount of CAPE in the given profile. The buoyancy array is typically computed by calling nwsspc.sharp.calc.parcel.Parcel.lift_parcel. Once the LFC and EL are found, the value are set in nwsspc.sharp.calc.parcel.Parcel.lfc_pres and nwsspc.sharp.calc.parcel.Parcel.eql_pres via the provided parcel.

The value of eql_pres is MISSING if there is no qualifying level found within the data bounds (e.g. incomplete data, or EL above the available data). Any calls to nwsspc.sharp.calc.parcel.Parcel.cape_cinh will still compute CAPE without the presence of an EL, using the best-available data.

Parameters:
  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of pressure values (Pa)

  • height (numpy.ndarray[dtype=float32]) – 1D NumPy array of height values (meters)

  • buoyancy (numpy.ndarray[dtype=float32]) – 1D NumPy array of buoyancy values (m/s^2)

Returns:

(LFC_PRES, EL_PRES)

Return type:

tuple[float, float]

maximum_parcel_level(self, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], height: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], buoyancy: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) float#

Find the pressure of the Maximum Parcel Level (MPL).

The Maximum Parcel Level (MPL) is the level a parcel woud reach if it expended all of its integrated positive buoyancy past the Equilibrium Level. It is found by integrating negatively buoyant area above the Equilibrium Level until the integrated negative buoyancy is equal in magnitude to the Convective Available Potential Energy between the Level of Free Convection and the Equilibrium Level.

For valid calculations, nwsspc.sharp.calc.parcel.Parcel.cape_cinh must be called first, or nwsspc.sharp.calc.parcel.Parcel.cape and nwsspc.sharp.calc.parcel.Parcel.eql_pressure must be set.

A values of nwsspc.sharp.calc.constants.MISSING is returned if:
  • CAPE is 0

  • nwsspc.sharp.calc.parce.Parcel.eql_pressure is MISSING

  • No valid MPL candidate is found within the profile In this scenario, it likely exceeds the top of the available data

In addition to being returned, the result is stored inside of nwsspc.sharp.calc.parcel.Parcel.mpl_pressure.

Parameters:
  • pres (numpy.ndarray[dtype=float32]) – 1D NumPy array of pressure values (Pa)

  • hght (numpy.ndarray[dtype=float32]) – 1D NumPy array of height values (meters)

  • buoyancy (numpy.ndarray[dtype=float32]) – 1D NumPy array of buoyancy values (m/s^2)

Returns:

The pressure of the Maximum Parcel Level (Pa)

Return type:

float

cape_cinh(self, pres: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], hght: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], buoy: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) tuple[float, float]#

Assuming that nwsspc.sharp.calc.parcel.Parcel.lift_parcel has been called, cape_cinh will integrate the area between the LFC and EL to compute CAPE, and integrate the area between the LPL and LCL to compute CINH.

If eql_pressure is MISSING, but lfc_pressure is defined, the routine will compute CAPE with the available data despite the lack of a defined equilibrium level. This is useful for incomplete profile data, or pressure-level data where the EL is above the top pressure value.

The results are stored in nwsspc.sharp.calc.parcel.Parcel.cape and nwsspc.sharp.calc.parcel.Parcel.cinh via the provided parcel.

Parameters:
  • pres (numpy.ndarray[dtype=float32]) – 1D NumPy array of pressure values (Pa)

  • hght (numpy.ndarray[dtype=float32]) – 1D NumPy array of height values (meters)

  • buoyancy (numpy.ndarray[dtype=float32]) – 1D NumPy array of buoyancy values (m/s^2)

Returns:

(CAPE, CINH)

Return type:

tuple[float, float]

class nwsspc.sharp.calc.parcel.DowndraftParcel(self)#
class nwsspc.sharp.calc.parcel.DowndraftParcel(self, pressure: float, temperature: float, dewpoint: float)

Contains information about a DowndraftParcel’s starting level and thermodynamic attributes, as well as derived computations, methods for constructing a parcel, and parcel descent routines.

Overloaded function.

  1. __init__(self) -> None

  2. __init__(self, pressure: float, temperature: float, dewpoint: float) -> None

Constructor for a DowndraftParcel

Parameters:
  • pressure (float) – DowndraftParcel initial pressure (Pa)

  • temperature (float) – DowndraftParcel initial temperature (K)

  • dewpoint (float) – DowndraftParcel initial dewpoint (K)

property pres#

DowndraftParcel starting pressure (Pa)

property tmpk#

DowndraftParcel starting temperature (K)

property dwpk#

DowndraftParcel starting dewpoint (K)

property cape#

DowndraftParcel Convective Available Potential Energy (J/kg)

property cinh#

DowndraftParcel Convective Inhibition (J/kg)

Parcel Definitions#

min_thetae(search_layer: nwsspc.sharp.calc.layer.PressureLayer, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], temperature: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], dewpoint: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], thetae: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], mean_depth: float = 10000.0) nwsspc.sharp.calc.parcel.DowndraftParcel#

Define a downdraft parcel.

Defines a downdraft parcel within a given search layer. The downdraft parcel is defined as the minimum layer-mean equivalent potential temperature (Theta-E) within the search layer. Typical values are to search within the lowest 400 hPa of the profile, and a mean depth of 100 hPa.

Parameters:
  • search_layer (nwsspc.sharp.calc.layer.PressureLayer) – The layer over which to search for the downdraft parcel

  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of pressure (Pa)

  • temperature (numpy.ndarray[dtype=float32]) – 1D NumPy array of temperature (K)

  • dewpoint (numpy.ndarray[dtype=float32]) – 1D NumPy array of dewpoint (K)

  • thetae (numpy.ndarray[dtype=float32]) – 1D NumPy array of thetae (K)

  • mean_depth (float) – The layer depth for calculating mean thetae.

Returns:

Downdraft Parcel

Return type:

nwsspc.sharp.calc.parcel.DowndraftParcel

Parcel Operations#

lower_parcel(self, lifter: nwsspc.sharp.calc.parcel.lifter_wobus, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) numpy.ndarray[dtype=float32, shape=(*), order='C']#
lower_parcel(self, lifter: nwsspc.sharp.calc.parcel.lifter_cm1, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) numpy.ndarray[dtype=float32, shape=(*), order='C']

Overloaded function.

  1. lower_parcel(self, lifter: nwsspc.sharp.calc.parcel.lifter_wobus, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> numpy.ndarray[dtype=float32, shape=(*), order='C']

Lowers a saturated nwsspc.sharp.calc.parcel.DowndraftParcel moist adiabatically from its LPL to the surface. The moist adiabat used is determined by the type of lifting functor passed to the function (i.e. lifter_wobus or lifter_cm1).

Unlike nwsspc.sharp.calc.parcel.Parcel.lift_parcel, the virtual temperature correction is not used for downdraft parcels.

Parameters:
Returns:

A 1D NumPy array of parcel temperature values (K)

Return type:

numpy.ndarray[dtype=float32]

  1. lower_parcel(self, lifter: nwsspc.sharp.calc.parcel.lifter_cm1, pressure: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) -> numpy.ndarray[dtype=float32, shape=(*), order='C']

Lowers a saturated nwsspc.sharp.calc.parcel.DowndraftParcel moist adiabatically from its LPL to the surface. The moist adiabat used is determined by the type of lifting functor passed to the function (i.e. lifter_wobus or lifter_cm1).

Unlike nwsspc.sharp.calc.parcel.Parcel.lift_parcel, the virtual temperature correction is not used for downdraft parcels.

Parameters:
  • lifter (nwsspc.sharp.calc.parcel.lifter_cm1) – An instantiated lifter_cm1 functor

  • pressure (numpy.ndarray[dtype=float32]) – 1D NumPy array of Pressure levels for lifting (Pa)

Returns:

A 1D NumPy array of parcel temperature values (K)

Return type:

numpy.ndarray[dtype=float32]

cape_cinh(self, pres: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], hght: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False], buoy: ndarray[dtype=float32, shape=(*), order='C', device='cpu', writable=False]) tuple[float, float]#

Assuming that nwsspc.sharp.calc.parcel.DowndraftParcel.lower_parcel has been called, cape_cinh will integrate the area between the LPL and the surface to compute downdraft CAPE and downdraft CINH.

The results are stored in nwsspc.sharp.calc.parcel.DowndraftParcel.cape and nwsspc.sharp.calc.parcel.DowndraftParcel.cinh via the provided parcel.

Parameters:
  • pres (numpy.ndarray[dtype=float32]) – 1D NumPy array of pressure values (Pa)

  • hght (numpy.ndarray[dtype=float32]) – 1D NumPy array of height values (meters)

  • buoyancy (numpy.ndarray[dtype=float32]) – 1D NumPy array of buoyancy values (m/s^2)

Returns:

(DCAPE, DCINH)

Return type:

tuple[float, float]