earthkit.meteo.thermo.specific_humidity_from_vapour_pressure

earthkit.meteo.thermo.specific_humidity_from_vapour_pressure(e: ArrayLike, p: ArrayLike, eps: float = 0.0001) ArrayLike
earthkit.meteo.thermo.specific_humidity_from_vapour_pressure(e: xarray.DataArray, p: xarray.DataArray, eps: float = 0.0001) xarray.DataArray
earthkit.meteo.thermo.specific_humidity_from_vapour_pressure(e: earthkit.data.FieldList, p: earthkit.data.FieldList, eps: float = 0.0001) earthkit.data.FieldList

Compute the specific humidity from vapour pressure.

Parameters:
  • e (array-like | xarray.DataArray) – Vapour pressure (Pa)

  • p (array-like | xarray.DataArray) – Pressure (Pa)

  • eps (number) – Where p - e < eps nan is returned.

Returns:

Specific humidity (kg/kg)

Return type:

array-like | xarray.DataArray

The computation is based on the following formula:

\[q = \frac{\epsilon e}{p + e(\epsilon-1)}\]

with \(\epsilon = R_{d}/R_{v}\) (see earthkit.meteo.constants.epsilon).

Implementations

specific_humidity_from_vapour_pressure() calls one of the following implementations depending on the type of the input arguments:

The function returns an object of the same type as the input arguments.