specific_humidity_from_relative_humidity
- specific_humidity_from_relative_humidity(t, r[, p])
New in Metview version 5.14.0.
Computes the specific humidity from the given temperature (
t
), relative_humidity (r
) and pressure (p
).- Parameters
- Return type
same type as
t
or None
The result is the specific humidity in kg/kg units. On error None is returned. The following rules are applied when
t
andr
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 133 (=specific humidity).The computation is based on the following equation:
\[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()
)t is the temperature
r is the relative humidity
Note
See also
relhum()
andrelative_humidity_from_specific_humidity()
.