Package 'humidity'

Title: Calculate Water Vapor Measures from Temperature and Dew Point
Description: Vapor pressure, relative humidity, absolute humidity, specific humidity, and mixing ratio are commonly used water vapor measures in meteorology. This R package provides functions for calculating saturation vapor pressure (hPa), partial water vapor pressure (Pa), relative humidity (%), absolute humidity (kg/m^3), specific humidity (kg/kg), and mixing ratio (kg/kg) from temperature (K) and dew point (K). Conversion functions between humidity measures are also provided.
Authors: Jun Cai [aut, cre]
Maintainer: Jun Cai <[email protected]>
License: GPL-3
Version: 0.1.5
Built: 2024-11-19 04:55:26 UTC
Source: https://github.com/caijun/humidity

Help Index


calculate absolute humidity

Description

calculate absolute humidity ρw\rho_w based on partial water vapor pressure ee at temperature tt

Usage

AH(e, t, isK = TRUE)

Arguments

e

partial water vapor pressure in Pascal (Pa)

t

temperature in Kelvin (K) or in degree Celsius (°C)

isK

logical indicator whether temperature is in Kelvin (K). The default value is TRUE.

Value

numeric absolute humidity ρw\rho_w (kg/m3kg/m^3)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

WVP1, WVP2, RH, SH.

Examples

t <- 273.15
Es <- SVP(t)
e <- WVP2(70, Es)
AH(e, t)

Celsius to Kelvin conversion

Description

convert temperature in degree Celsius (°C) into Kelvin (K)

Usage

C2K(C)

Arguments

C

temperature in degree Celsius (°C)

Value

numeric temperature in Kelvin (K)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

K2C.

Examples

T0 # absolute zero in Kelvin (K)
C2K(T0)

Saturation vapor pressure at absolute zero (hPa)

Description

es(T0)=6.11hPae_s(T_0) = 6.11hPa is the saturation vapor pressure at the absolute zero T0=273.15KT_0 = 273.15K.

Usage

Es.T0

Format

An object of class numeric of length 1.

See Also

T0


Viability of influenza A virus for 1 hour after spraying

Description

A dataset containing airborne virus particles of influenza A for viable survival in the dark at controlled temperature and relative humidity for 1 hour after spraying.

Usage

ivs

Format

A data frame with 11 rows and 3 variables:

  • T: temperature in degree Celsius (7.5–32.0)

  • RH: relative humidity in percentage (20–82)

  • PV: percentage of viable virus (6.6–78.0)

Source

Harper, G. J. (1961). Airborne micro-organisms: survival tests with four viruses. Journal of Hygiene, 59(04), 479-486.


Aerosol transmission efficiency of influenza A virus from guinea pigs to guinea pigs

Description

A dataset containing aerosol transmission efficiency of influenza A virus from four infected guinea pigs to four exposed guinea pigs under conditions of controlled temperature and relative humidity.

Usage

ivt

Format

A data frame with 24 rows and 4 variables:

  • T: temperature in degree Celsius (5–30)

  • RH: relative humidity in percentage (20–80)

  • PT: transmission efficiency in percentage (0–100)

  • source: data source

Source

Lowen, A. C., Mubareka, S., Steel, J., & Palese, P. (2007). Influenza virus transmission is dependent on relative humidity and temperature. PLoS pathogens, 3(10), e151.

Lowen, A. C., Steel, J., Mubareka, S., & Palese, P. (2008). High temperature (30℃) blocks aerosol but not contact transmission of influenza virus. Journal of virology, 82(11), 5650-5652.


Kelvin to Celsius conversion

Description

convert temperature in Kelvin (K) into degree Celsius (°C)

Usage

K2C(K)

Arguments

K

temperature in Kelvin (K)

Value

numeric temperature in degree Celsius (°C)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

C2K.

Examples

K2C(0)

Latent heat of water vapor

Description

Latent heat of water vapor L=2.5×106J/kgL = 2.5 \times 10^6J/kg

Usage

L

Format

An object of class numeric of length 1.


Molecular weight of dry air

Description

Molecular weight of dry air Md=28.9634g/molM_d = 28.9634g/mol

Usage

Md

Format

An object of class numeric of length 1.

See Also

Mw


calculate mixing ratio

Description

calculate mixing ratio ω\omega based on specific humidity qq

Usage

MR(q)

Arguments

q

specific humidity qq (kg/kgkg/kg)

Value

numeric mixing ratio ω\omega (kg/kgkg/kg)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

SH.

Examples

t <- 273.15
Es <- SVP(t)
e <- WVP2(70, Es)
q <- SH(e, p = 101325)
MR(q)

Molecular weight of water vapor

Description

Molecular weight of water vapor Mw=18.01528g/molM_w = 18.01528g/mol

Usage

Mw

Format

An object of class numeric of length 1.

See Also

Md


calculate relative humidity

Description

calculate relative humidity ψ\psi based on temperature tt and dew point TdT_d

Usage

RH(t, Td, isK = TRUE)

Arguments

t

temperature in Kelvin (K) or in degree Celsius (°C)

Td

dew point in Kelvin (K) or in degree Celsius (°C)

isK

logical indicator whether temperature is in Kelvin (K). The default value is TRUE.

Value

numeric relative humidity in

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

AH, SH.

Examples

RH(30, 15, isK = FALSE)

Specific gas constant of water vapor

Description

Specific gas constant of water vapor Rw=1000RMw=461.52J/(kgK)R_w = \frac{1000R}{M_w} = 461.52J/(kgK), where R=8.3144621J/(molK)R = 8.3144621J/(molK) is the molar gas constant and Mw=18.01528g/molM_w = 18.01528g/mol is the molecular weight of water vapor.

Usage

Rw

Format

An object of class numeric of length 1.

See Also

Mw


calculate specific humidity

Description

calculate specific humidity qq based on partial water vapor pressure ee under given atmospheric pressure pp

Usage

SH(e, p = 101325)

Arguments

e

partial water vapor pressure in Pascal (Pa)

p

atmospheric pressure in Pascal (Pa). The default is standard atmospheric pressure of 101325Pa.

Value

numeric specific humidity qq (kg/kgkg/kg)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

WVP2, WVP2, AH, RH, MR.

Examples

t <- 273.15
Es <- SVP(t)
e <- WVP2(70, Es)
SH(e, p = 101325)

convert specific humidity into relative humidity

Description

Climate models usually provide specific humidity only; however, relative humidity is used to compute heat index that is really useful for health impacts studies. This function converts specific humidity qq into relative humidity ψ\psi at temperature tt and under atmospheric pressure qq.

Usage

SH2RH(q, t, p = 101325, isK = TRUE)

Arguments

q

specific humidity qq (kg/kgkg/kg)

t

temperature in Kelvin (K) or in degree Celsius (°C)

p

atmospheric pressure in Pascal (Pa). The default is standard atmospheric pressure of 101325Pa.

isK

logical indicator whether temperature is in Kelvin (K). The default value is TRUE.

Value

numeric relative humidity in

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

AH, SH.

Examples

SH2RH(0.005867353, 22.25, p = 101325, isK = FALSE)

calculate saturation vapor pressure

Description

calculate saturation vapor pressure EsE_s at temperature tt, using the Clausius-Clapeyron equation or the Murray equation.

Usage

SVP(t, isK = TRUE, formula = c("Clausius-Clapeyron", "Murray"))

Arguments

t

temperature in Kelvin (K) or in degree Celsius (°C)

isK

logical indicator whether temperature is in Kelvin (K). The default value is TRUE.

formula

the formula is used for calculating saturation vapor pressure. By default the Clausius-Clapeyron equation is used.

Value

numeric saturation vapor pressure in hectopascal (hPa) or millibar (mb)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

SVP.ClaCla, SVP.Murray.

Examples

SVP(273.15)

calculate saturation vapor pressure using the Clausius-Clapeyron equation

Description

calculate saturation vapor pressure EsE_s at temperature tt, using the Clausius-Clapeyron equation.

Usage

SVP.ClaCla(t)

Arguments

t

temperature in Kelvin (K)

Value

numeric saturation vapor pressure in hectopascal (hPa) or millibar (mb)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

References

Shaman, J., & Kohn, M. (2009). Absolute humidity modulates influenza survival, transmission, and seasonality. Proceedings of the National Academy of Sciences, 106(9), 3243-3248.

Wallace, J. M., & Hobbs, P. V. (2006). Atmospheric science: an introductory survey (Vol. 92). Academic press.

See Also

SVP.Murray, SVP.

Examples

T0 # absolute zero in Kelvin (K)
SVP.ClaCla(T0)

calculate saturation vapor pressure using the Murray equation

Description

calculate saturation vapor pressure EsE_s at temperature tt, per the equation proposed by Murray (1967).

Usage

SVP.Murray(t)

Arguments

t

temperature in Kelvin (K)

Value

numeric saturation vapor pressure in hectopascal (hPa) or millibar (mb)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

References

Murray, F. W. (1967). On the Computation of Saturation Vapor Pressure. Journal of Applied Meteorology, 6(1), 203-204.

See Also

SVP.ClaCla, SVP.

Examples

T0 # absolute zero in Kelvin (K)
SVP.Murray(T0)

Absolute zero

Description

Absolute zero in Kelvin T0T_0 (K)

Usage

T0

Format

An object of class numeric of length 1.


calculate partial water vapor pressure given dew point

Description

calculate partial water vapor pressure ee based on dew point TdT_d

Usage

WVP1(Td, isK = TRUE)

Arguments

Td

dew point in Kelvin (K) or in degree Celsius (°C)

isK

logical indicator whether temperature is in Kelvin (K). The default value is TRUE.

Value

numeric partial vapor pressure in hectopascal (hPa) or millibar (mb)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

SVP, SVP.ClaCla.

Examples

T0 # absolute zero in Kelvin (K)
WVP1(T0)

calculate partial water vapor pressure given relative humidity and saturation water vapor pressure

Description

calculate partial water vapor pressure ee based on relative humdity ψ\psi and saturation water vapor pressure at temperature tt

Usage

WVP2(psi, Es)

Arguments

psi

relative humidity ψ\psi in percentage (%\%)

Es

saturation vapor pressure ese_s(hPa) at temperature tt, which can be calculated by callling SVP function.

Value

numeric partial water vapor pressure in Pascal (Pa)

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

SVP, SVP.ClaCla, SVP.Murray.

Examples

Es <- SVP(273.15)
WVP2(70, Es)