virtual_temperature

virtual_temperature(t, q)

New in Metview version 5.13.0.

Computes the virtual temperature from the given temperature (t) and specific humidity (q).

Parameters
  • t (number, ndarray or Fieldset) – temperature (K)

  • q (number, ndarray or Fieldset) – specific humidity (kg/kg)

Return type

same type as t or None

The result is the virtual temperature in K units. On error None is returned.

When the result is a Fieldset the ecCodes paramId in the output is set to 300012 (=virtual temperature).

The computation is based on the following formula:

\[T_{v} = T (1 + \frac{1 - \epsilon}{\epsilon} q)\]

where

  • T is the temperature

  • q is the specific humidity

  • \(\epsilon = \frac{R_{dry}}{R_{vapour}} = 0.621981\)