earthkit.meteo.thermo.mixing_ratio_from_specific_humidity¶
- earthkit.meteo.thermo.mixing_ratio_from_specific_humidity(q: ArrayLike) ArrayLike¶
- earthkit.meteo.thermo.mixing_ratio_from_specific_humidity(q: xarray.DataArray) xarray.DataArray
- earthkit.meteo.thermo.mixing_ratio_from_specific_humidity(q: earthkit.data.FieldList) earthkit.data.FieldList
Compute the mixing ratio from specific humidity.
- Parameters:
q (
array-like | xarray.DataArray) – Specific humidity (kg/kg)- Returns:
Mixing ratio (kg/kg)
- Return type:
array-like | xarray.DataArray
The result is the mixing ratio in kg/kg units. The computation is based on the following definition [Wallace2006]:
\[w = \frac {q}{1-q}\]Implementations¶
mixing_ratio_from_specific_humidity()calls one of the following implementations depending on the type of the input arguments:earthkit.meteo.thermo.array.mixing_ratio_from_specific_humidity()for array-likeearthkit.meteo.thermo.xarray.mixing_ratio_from_specific_humidity()for xarray.DataArrayearthkit.meteo.thermo.fieldlist.mixing_ratio_from_specific_humidity()for FieldList
The function returns an object of the same type as the input arguments.