earthkit.meteo.thermo.virtual_temperature¶
- earthkit.meteo.thermo.virtual_temperature(t: ArrayLike, q: ArrayLike) ArrayLike¶
- earthkit.meteo.thermo.virtual_temperature(t: xarray.DataArray, q: xarray.DataArray) xarray.DataArray
- earthkit.meteo.thermo.virtual_temperature(t: earthkit.data.FieldList, q: earthkit.data.FieldList) earthkit.data.FieldList
Compute the virtual temperature from temperature and specific humidity.
- Parameters:
t (
numberorarray-like) – Temperature (K)sq (
numberorarray-like) – Specific humidity (kg/kg)
- Returns:
Virtual temperature (K)
- Return type:
numberorarray-like
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).Implementations¶
virtual_temperature()calls one of the following implementations depending on the type of the input arguments:earthkit.meteo.thermo.array.virtual_temperature()for array-likeearthkit.meteo.thermo.xarray.virtual_temperature()for xarray.DataArrayearthkit.meteo.thermo.fieldlist.virtual_temperature()for FieldList
The function returns an object of the same type as the input arguments.