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
  • t (number, ndarray or Fieldset) – temperature (K)

  • q (number, ndarray or Fieldset) – specific humidity (kg/kg)

  • p (number, ndarray or Fieldset) – pressure (Pa)

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 and q are Fieldset objects:

  • if t is a pressure level Fieldset no p is needed

  • if 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 a Fieldset defining the pressure on the same levels as t

  • for other level types p must be a Fieldset defining the pressure on the same levels as t

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:

Note

For Fieldset data on pressure and model levels relative_humidity_from_specific_humidity() gives equivalent results to relhum().