pyrtlib.utils.virtual_temperature#

pyrtlib.utils.virtual_temperature(t: ndarray, mr: ndarray) ndarray#

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

\[T_v = T \frac{\text{w} + \epsilon}{\epsilon\,(1 + \text{w})}\]
Parameters:
Returns:

Corresponding virtual temperature of the parcel

Return type:

numpy.ndarray

Examples

>>> from pyrtlib.utils import virtual_temperature
>>> virtual_temperature(283.2, 12*1e-3)
285.2412547754703

Note

This function is based on metpy.calc.virtual_temperature method.