earthkit.meteo.thermo.mixing_ratio_from_vapour_pressure¶
- earthkit.meteo.thermo.mixing_ratio_from_vapour_pressure(e: ArrayLike, p: ArrayLike, eps: float = 0.0001) ArrayLike¶
- earthkit.meteo.thermo.mixing_ratio_from_vapour_pressure(e: xarray.DataArray, p: xarray.DataArray, eps: float = 0.0001) xarray.DataArray
- earthkit.meteo.thermo.mixing_ratio_from_vapour_pressure(e: earthkit.data.FieldList, p: earthkit.data.FieldList, eps: float = 0.0001) earthkit.data.FieldList
Compute the mixing ratio from vapour pressure.
- Parameters:
e (
array-like | xarray.DataArray) – Vapour pressure (Pa)p (
array-like | xarray.DataArray) – Pressure (Pa)eps (
number) – Where p - e <epsnan is returned.
- Returns:
Mixing ratio (kg/kg).
- Return type:
array-like | xarray.DataArray
The computation is based on the following formula:
\[w = \frac{\epsilon e}{p - e}\]with \(\epsilon = R_{d}/R_{v}\) (see
earthkit.meteo.constants.epsilon).Implementations¶
mixing_ratio_from_vapour_pressure()calls one of the following implementations depending on the type of the input arguments:earthkit.meteo.thermo.array.mixing_ratio_from_vapour_pressure()for array-likeearthkit.meteo.thermo.xarray.mixing_ratio_from_vapour_pressure()for xarray.DataArrayearthkit.meteo.thermo.fieldlist.mixing_ratio_from_vapour_pressure()for FieldList
The function returns an object of the same type as the input arguments.