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
t
or None
The result is the relative humidity in % units. On error None is returned. The following rules are applied when
t
andq
areFieldset
objects:if
t
is a pressure levelFieldset
nop
is neededif
t
is defined on ECMWF model levels (hybrid/eta)p
must be either a single LNSP (logarithm of surface pressure, identified by paramId=152) field or aFieldset
defining the pressure on the same levels ast
for other level types
p
must be aFieldset
defining the pressure on the same levels ast
When the result is a
Fieldset
the 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
Fieldset
data on pressure and model levelsrelative_humidity_from_specific_humidity()
gives equivalent results torelhum()
.Note
See also
relhum()
andspecific_humidity_from_relative_humidity()
.