density¶
-
metpy.calc.
density
(pressure, temperature, mixing, molecular_weight_ratio=<Quantity(0.621980086, 'dimensionless')>)[source]¶ Calculate density.
This calculation must be given an air parcel’s pressure, temperature, and mixing ratio. The implementation uses the formula outlined in [Hobbs2006] pg.67.
- Parameters
pressure (
pint.Quantity
) – Total atmospheric pressuretemperature (
pint.Quantity
) – air temperaturemixing (
pint.Quantity
) – dimensionless mass mixing ratiomolecular_weight_ratio (
pint.Quantity
or float, optional) – The ratio of the molecular weight of the constituent gas to that assumed for air. Defaults to the ratio for water vapor to dry air. (\(\epsilon\approx0.622\)).
- Returns
pint.Quantity
– The corresponding density of the parcel
Notes
\[\rho = \frac{p}{R_dT_v}\]