earthkit.meteo.thermo.relative_humidity_from_specific_humidity¶
- earthkit.meteo.thermo.relative_humidity_from_specific_humidity(t: ArrayLike, q: ArrayLike, p: ArrayLike) ArrayLike¶
- earthkit.meteo.thermo.relative_humidity_from_specific_humidity(t: xarray.DataArray, q: xarray.DataArray, p: xarray.DataArray) xarray.DataArray
- earthkit.meteo.thermo.relative_humidity_from_specific_humidity(t: earthkit.data.FieldList, q: earthkit.data.FieldList, p: earthkit.data.FieldList) earthkit.data.FieldList
Compute the relative humidity from specific humidity.
- Parameters:
t (
array-like) – Temperature (K)q (
array-like) – Specific humidity (kg/kg)p (
array-like) – Pressure (Pa)
- Returns:
Relative humidity (%)
- Return type:
array-like
The computation is based on the following formula:
\[r = 100 \frac {e(q, p)}{e_{msat}(t)}\]where:
\(e\) is the vapour pressure (see
vapour_pressure_from_specific_humidity())\(e_{msat}\) is the
saturation_vapour_pressure()based on the "mixed" phase
Implementations¶
relative_humidity_from_specific_humidity()calls one of the following implementations depending on the type of the input arguments:earthkit.meteo.thermo.array.relative_humidity_from_specific_humidity()for array-likeearthkit.meteo.thermo.xarray.relative_humidity_from_specific_humidity()for xarray.DataArrayearthkit.meteo.thermo.fieldlist.relative_humidity_from_specific_humidity()for FieldList
The function returns an object of the same type as the input arguments.