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:
t (numpy.ndarray) – Air temperature (K)
mr (numpy.ndarray) – Mass mixing ratio (dimensionless kg/kg-1)
- Returns:
Corresponding virtual temperature of the parcel
- Return type:
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.