relative_humidity_from_specific_humidity
- relative_humidity_from_specific_humidity(t, q[, p])
New in Metview version 5.14.0.
Computes the relative humidity from the given temperature (
t) and specific humidity (q) and pressure (p).- Parameters
- Return type
same type as
tor None
The result is the relative humidity in % units. On error None is returned. The following rules are applied when
tandqareFieldsetobjects:if
tis a pressure levelFieldsetnopis neededif
tis defined on ECMWF model levels (hybrid/eta)pmust be either a single LNSP (logarithm of surface pressure, identified by paramId=152) field or aFieldsetdefining the pressure on the same levels astfor other level types
pmust be aFieldsetdefining the pressure on the same levels ast
When the result is a
Fieldsetthe ecCodes paramId in the output is set to 157 (=relative humidity).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())emsat is the saturation vapour pressure based on the “mixed” phase (see
saturation_vapour_pressure())q is the specific humidity
p is the pressure
t is the temperature
Note
For
Fieldsetdata on pressure and model levelsrelative_humidity_from_specific_humidity()gives equivalent results torelhum().Note
See also
relhum()andspecific_humidity_from_relative_humidity().