dparcel.environment module

Tools for specifying environmental profiles in dparcel.

The Environment class allows the user to supply real atmospheric sounding data to use for parcel calculations. Alternatively, the idealised_sounding function can be used to generate an Environment instance using an idealised sounding.

class dparcel.environment.Environment(pressure, height, temperature, dewpoint, liquid_ratio=None, info='', name='')

Bases: object

Class for atmospheric sounding data.

__init__(pressure, height, temperature, dewpoint, liquid_ratio=None, info='', name='')

Instantiate an Environment.

Parameters
  • pressure – Pressure array in the sounding.

  • height – Height array in the sounding.

  • temperature – Temperature array in the sounding.

  • dewpoint – Dewpoint array in the sounding.

  • liquid_ratio – Array of liquid water partial density to total density in the sounding (optional, defaults to all zero).

  • info – Information to store with the sounding, e.g. date (optional)

  • name – Short name for the sounding, e.g. ‘Sydney’ (optional).

dcape_dcin(samples=10000)

Compute DCAPE and DCIN according to Market et. al. (2017).

Parameters

samples – Number of samples to use for integration (optional).

Returns

DCAPE and DCIN for the sounding.

References

Market, PS, Rochette, SM, Shewchuk, J, Difani, R, Kastman, JS, Henson, CB & Fox, NI 2017, ‘Evaluating elevated convection with the downdraft convective inhibition’, Atmospheric science letters, vol. 18, no. 2, pp. 76–81.

density(height)

Find the environmental density at a given height.

dewpoint(height)

Find the environmental dew point at a given height.

dewpoint_from_pressure(pressure)

Find the environmental dew point at a given pressure.

dry_static_energy(height)

Find the environmental dry static energy at a given height.

equivalent_potential_temperature(height)

Find the environmental equivalent potential temperature.

Uses the approximation of eq. (39) in Bolton (1980).

References

Bolton, D 1980, ‘The Computation of Equivalent Potential Temperature’, Monthly weather review, vol. 108, no. 7, pp. 1046–1053.

height(pressure)

Find the height at a given environmental pressure.

liquid_ratio(height)

Find the environmental liquid ratio at a given height.

liquid_ratio_from_pressure(pressure)

Find the environmental liquid ratio at a given pressure.

mixing_ratio(height)

Find the environmental mixing ratio at a given height.

moist_static_energy(height)

Find the environmental moist static energy at a given height.

potential_temperature(height)

Find the environmental potential temperature at a given height.

pressure(height)

Find the environmental pressure at a given height.

relative_humidity(height)

Find the environmental relative humidity at a given height.

specific_humidity(height)

Find the environmental specific humidity at a given height.

temperature(height)

Find the environmental temperature at a given height.

temperature_from_pressure(pressure)

Find the environmental temperature at a given pressure.

virtual_temperature(height)

Find the environmental virtual temperature at a given height.

wetbulb_temperature(height)

Find the environmental wet-bulb temperature at a given height.

Uses the approximation of eq. (39) in Bolton (1980) for equivalent potential temperature, and the approximation of Davies-Jones (2008) to find the wet bulb temperature.

References

DAVIES-JONES, R 2008, ‘An Efficient and Accurate Method for Computing the Wet-Bulb Temperature along Pseudoadiabats’, Monthly weather review, vol. 136, no. 7, pp. 2764–2785.

Bolton, D 1980, ‘The Computation of Equivalent Potential Temperature’, Monthly weather review, vol. 108, no. 7, pp. 1046–1053.

dparcel.environment.idealised_sounding(relative_humidity)

Create an idealised sounding.

The sounding has a 160 mbar thick boundary layer with a dry adiabatic temperature profile, a 10 mbar thick capping inversion and a moist adiabatic temperature profile above the boundary layer. The specific humidity is constant in the boundary layer, and the relative humidity is constant above the boundary layer.

The sounding is assumed to be hydrostatic; the sounding is first defined in terms of pressure, then a nested function dzdp is defined and we numerically solve dzdp(p, z) = -1/(rho*g).

Parameters

relative_humidity – Relative humidity above the boundary layer.

Returns

Arrays of pressure, height, temperature and specific humidity in the sounding.