earthkit.meteo.thermo.xarray.virtual_temperature

earthkit.meteo.thermo.xarray.virtual_temperature(t, q)

Compute the virtual temperature from temperature and specific humidity.

Parameters:
  • t (xarray.DataArray) – Temperature (K)s

  • q (xarray.DataArray) – Specific humidity (kg/kg)

Returns:

Virtual temperature (K)

Return type:

xarray.DataArray

The computation is based on the following formula [Wallace2006]:

\[t_{v} = t (1 + \frac{1 - \epsilon}{\epsilon} q)\]

with \(\epsilon = R_{d}/R_{v}\) (see earthkit.meteo.constants.epsilon).