easyclimate.physics.temperature.virtual_temperature

Virtual Temperature

Functions

calc_virtual_temperature(→ xarray.DataArray)

Calculate virtual temperature.

calc_virtual_temperature_Hobbs2006(→ xarray.DataArray)

Calculate virtual temperature.

Module Contents

easyclimate.physics.temperature.virtual_temperature.calc_virtual_temperature(temper_data: xarray.DataArray, specific_humidity_data: xarray.DataArray, specific_humidity_data_units: Literal['kg/kg', 'g/g', 'g/kg'], epsilon: float = 0.608) xarray.DataArray

Calculate virtual temperature.

The virtual temperature (\(T_v\)) is the temperature at which dry air would have the same density as the moist air, at a given pressure. In other words, two air samples with the same virtual temperature have the same density, regardless of their actual temperature or relative humidity. The virtual temperature is always greater than the absolute air temperature.

\[T_v = T(1+ \epsilon q)\]

where \(\epsilon = 0.608\) when the mixing ratio (specific humidity) \(q\) is expressed in \(\mathrm{g \cdot g^{-1}}\).

Parameters

temper_data: xarray.DataArray.

Air temperature.

specific_humidity_data: xarray.DataArray.

The absolute humidity data.

specific_humidity_data_units: str.

The unit corresponding to specific_humidity value. Optional values are kg/kg, g/g, g/kg and so on.

epsilon: float.

A constant.

Returns

The virtual temperature, units according to temper_data.

xarray.DataArray.

Reference

easyclimate.physics.temperature.virtual_temperature.calc_virtual_temperature_Hobbs2006(temper_data: xarray.DataArray, specific_humidity_data: xarray.DataArray, specific_humidity_data_units: Literal['kg/kg', 'g/g', 'g/kg'], epsilon: float = 0.6219569100577033) xarray.DataArray

Calculate virtual temperature.

The virtual temperature (\(T_v\)) is the temperature at which dry air would have the same density as the moist air, at a given pressure. In other words, two air samples with the same virtual temperature have the same density, regardless of their actual temperature or relative humidity. The virtual temperature is always greater than the absolute air temperature.

This calculation must be given an air parcel’s temperature and mixing ratio. The implementation uses the formula outlined in [Hobbs2006] pg.67 & 80.

\[T_v = T \frac{\text{q} + \epsilon}{\epsilon\,(1 + \text{q})}\]

where \(\epsilon \approx 0.622\) when the mixing ratio (specific humidity) \(q\) is expressed in \(\mathrm{g \ g^{-1}}\).

Parameters

temper_data: xarray.DataArray.

Air temperature.

specific_humidity_data: xarray.DataArray.

The absolute humidity data.

specific_humidity_data_units: str.

The unit corresponding to specific_humidity value. Optional values are kg/kg, g/g, g/kg and so on.

epsilon: float.

The molecular weight ratio, which is molecular weight of the constituent gas to that assumed for air. Defaults to the ratio for water vapor to dry air. (\(\epsilon \approx 0.622\))

Returns

The virtual temperature, units according to temper_data.

xarray.DataArray.

Reference