earthkit.meteo.thermo.xarray.specific_humidity_from_relative_humidity

earthkit.meteo.thermo.xarray.specific_humidity_from_relative_humidity(t, r, p)

Compute the specific humidity from relative_humidity.

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

  • r (xarray.DataArray) – Relative humidity(%)

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

Returns:

Specific humidity (kg/kg) units

Return type:

xarray.DataArray

The computation starts with determining the the vapour pressure:

\[e(q, p) = r \frac{e_{msat}(t)}{100}\]

where:

  • \(e\) is the vapour pressure (see vapour_pressure())

  • \(e_{msat}\) is the saturation_vapour_pressure() based on the “mixed” phase

  • \(q\) is the specific humidity

Then \(q\) is computed from \(e\) using specific_humidity_from_vapour_pressure().