earthkit.meteo.thermo.xarray.saturation_mixing_ratio

earthkit.meteo.thermo.xarray.saturation_mixing_ratio(t, p, phase='mixed')

Compute the saturation mixing ratio from temperature with respect to a phase.

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

  • p (xarray.DataArray) – Pressure (Pa)

  • phase (str) – Define the phase with respect to the saturation_vapour_pressure() is computed. It is either “water”, “ice” or “mixed”.

Returns:

Saturation mixing ratio (kg/kg)

Return type:

xarray.DataArray

Equivalent to the following code:

e = saturation_vapour_pressure(t, phase=phase)
return mixing_ratio_from_vapour_pressure(e, p)