Compute dewpoint temperature from temperature and relative humidity
Source:R/met_functions.R
met_functions.Rd
The computation of dewpoint temperature is done using the formula
$$\frac{b\left(ln(RH) + \left(\frac{aT}{(b+T)}\right)\right)}{\left(a-\left(ln(RH) + \left(\frac{aT}{(b+T)}\right)\right)\right)}$$
And the computation for relative humidity is done following
$$RH=\frac{e}{e_s}$$
where
$$e=\frac{QP}{0.378Q+0.622}$$
$$e_s=6.112e^{\frac{aT}{b+T}}$$
In the above formulae:
\(T\) is the temperature in \(\degree C\)
\(RH\) is the relative humidity expressed as a decimal between 0 and 1
\(Q\) is the specific humidity in \(kg.kg^{-1}\)
\(P\) is the atmospheric pressure in \(hPa\)
\(a\) and \(b\) are tuning parameters
The default values for \(a\) and \(b\) are 17.67 and 243.5 respectively as
recommended by NOAA.
Arguments
- rh
A vector of relative humidities expressed as decimal fractions between 0 and 1. If the maximum is greater than 5, it is assumed that all relative humidities are in \(\%\) and will be divided by 100.
- t
A vector of the same length as
rh
temperatures in \(\degree C\). If the maximum is greater than 200, it is assumed that all temperatures are in \(Kelvin\) and they will be converted to to \(\degree C\).- a
A tuning parameter. The default value is \(17.67\).
- b
A tuning parameter. The default value is \(243.5\).
- q
The specific humidity in \(kg.kg^{-1}\)
- p
The air pressure in \(hPa\)
Details
Other tunings for \(a\) and \(b\) are possible:
\(a=17.27\), \(b=237.3\) is valid for \(0\lt T \lt 60\)
Alternatively:
\(a=17.62\), \(b=243.12\)
\(a=17.625\), \(b=243.04\)
Finally A.L. Buck (1981) recommends different tunings based on temperature:
\(a=17.368\), \(b=238.88\) for \(T \gt 0\)
\(a=17.966\), \(b=247.15\) for \(T \lt 0\)
Note that the formulation used for dewpoint temperature does not take atmospheric pressure into account, so may not be correct at higher altitudes.
Examples
rh_to_td(0.8, 20)
#> [1] 16.44765
# In Kelvin and %
rh_to_td(80, 293.15)
#> Warning: rh assumed to be in %. Coverting to 0-1.
#> Warning: t assumed to be in K. Converting to degrees C.
#> [1] 16.44765
#
# Relative humidity is returned as a decimal fraction between 0 and 1
q_to_rh(0.013, 20)
#> [1] 0.8990899