gas_volume_to_mass: Functions to convert gas concentrations between volume- and...

View source: R/gas_volume_to_mass.R

gas_volume_to_massR Documentation

Functions to convert gas concentrations between volume- and mass-units.

Description

Use gas_volume_to_mass when a gas concentration is in ppb or ppm and ug m-3 or mg m-3 is desired. Use gas_mass_to_volume when a gas concentration is in ug m-3 or mg m-3 and ppb or ppm is desired.

Usage

gas_volume_to_mass(
  volume,
  gas,
  molecular_mass = NA,
  unit_input = "ppb",
  unit_output = "ug_m3",
  temp = 0,
  pressure = 101325
)

gas_mass_to_volume(
  mass,
  gas,
  molecular_mass = NA,
  unit_input = "ug_m3",
  unit_output = "ppb",
  temp = 0,
  pressure = 101325
)

milligram_to_microgram(x)

microgram_to_milligram(x)

ppb_to_ppm(x)

ppm_to_ppb(x)

ppt_to_ppb(x)

ppb_to_ppt(x)

Arguments

volume

Gas concentration in ppb or ppm.

gas

A string such as "o3", "co", or "co2" which represents the input gas. This is used to find the molecular mass of a gas. Every gas-species will never be supported, therefore, use the molecular_mass argument if your gas is not implemented.

molecular_mass

Molecular mass of gas in g mol-1. For example, for ozone, this is 48 and for carbon monoxide this is 28.01.

unit_input, unit_output

Input and output units.

temp

Default is 0 degrees Celsius. However, values such as 20 or 25 degrees Celsius are often used.

pressure

Default is 101325 Pa (1 standard atmosphere).

mass

Gas concentration in ug m-3 or mg m-3.

x

Vector of gases to convert.

Details

These functions allow for input of temperatures and pressures which change the coefficients used for the conversion between the unit systems, they do not use conversion factors.

Value

Numeric vector.

Author(s)

Stuart K. Grange

See Also

molecular_mass_table

Examples


# Ozone
# From ppb
gas_volume_to_mass(400, "o3")

# To ug m-3
gas_mass_to_volume(800, "o3")

# For monitoring sites in Europe where conversions are done at 20 degrees
gas_mass_to_volume(2.24, "no", temp = 20, unit_output = "ppb")
gas_mass_to_volume(24.53, "no2", temp = 20, unit_output = "ppb")
gas_mass_to_volume(37.74, "o3", temp = 20, unit_output = "ppb")

# CO usually uses different units
gas_mass_to_volume(
  mass = 0.39, 
  gas = "co", 
  unit_input = "mg_m3",
  temp = 20, 
  unit_output = "ppb"
 )

# NOx as NO2
gas_volume_to_mass(14.64, "no2", temp = 20, unit_input = "ppb")


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.