R/compute_relative_humidity.R
compute_relative_humidity.RdUses the August-Roche-Magnus approximation to derive relative humidity from the 2-metre air temperature and dew-point temperature.
compute_relative_humidity(t2m, dpt2m)Numeric vector of relative humidity values in percent (0-100).
Returns NA where either input is NA. Values are not clamped, so
rounding errors may produce results marginally outside 0-100.
The August-Roche-Magnus approximation is:
$$RH = 100 \times \frac{\exp\!\bigl(\tfrac{17.625\,T_d}{243.04 + T_d}\bigr)} {\exp\!\bigl(\tfrac{17.625\,T}{243.04 + T}\bigr)}$$
where \(T\) is the air temperature and \(T_d\) is the dew-point temperature, both in degrees Celsius. The coefficients (17.625 and 243.04) follow Alduchov & Eskridge (1996).
Alduchov, O. A., & Eskridge, R. E. (1996). Improved Magnus form approximation of saturation vapor pressure. Journal of Applied Meteorology, 35(4), 601–609.