emis_chem: (in development, needs checks) Aggregate emissions by lumped...

View source: R/emis_chem.R

emis_chemR Documentation

(in development, needs checks) Aggregate emissions by lumped groups in chemical mechanism

Description

emis_chem aggregates emissions by chemical mechanism and convert grams to mol. This function reads all hydrocarbos and respective criteria polluants specified in ef_ldv_speed and ef_hdv_speed.

Usage

emis_chem(dfe, mechanism, colby, long = FALSE)

Arguments

dfe

data.frame with column 'emissions' in grams and 'pollutant' in long format. It is supposed that each line is the pollution of some region. Then the 'coldby' argument is for include the name of the region.

mechanism

Character, "SAPRC", "RACM", "RADM2", "CBMZ", "MOZART", "SAPRC99", "CB05", "CB06CMAQ", "CB05CMAQ", "RACM2CMAQ", "SAPRC99CMAQ", "SAPRC07CMAQ", "SAPRC07A", "RADM2_SORG", "CBMZ_MOSAIC", "CPTEC", "GOCART_CPTEC", "MOZEM", "MOZCEM", "CAMMAM", "MOZMEM", "MOZC_T1_EM", "CB05_OPT1", "CB05_OPT2", "CRIMECH"

colby

Character indicating column name for aggregating extra column. For instance, region or province.

long

Logical. Do you want data in long format?

Value

data.frame with lumped groups by chemical mechanism. It transform emissions in grams to mol.

Note

This feature is experimental and the mapping of pollutants and lumped species may change in future. This function is converting the intial data.frame input into data.table. To have a comprehensive speciation is necessary enter with a data.frame with colum 'emission' in long format including another column named 'pollutant' with species of NMHC, CO, NO, NO2, NH3, SO2, PM2.5 and coarse PM10.

Groups derived from gases has units 'mol' and from aersols 'g'. The aersol units for WRF-Chem are ug/m^2/s while for CMAQ and CAMx are g/s. So, leaving the units just in g, allow to make further change while providing flexibility for several models. TODO: Enter with wide data.frame, with each line as a each street, each column for pollutant

See Also

ef_ldv_speed ef_hdv_speed speciate ef_evap

Examples

## Not run: 
# CO
df <- data.frame(emission = Emissions(1:10))
df$pollutant = "CO"
emis_chem(dfe = df, "CBMZ_MOSAIC")
# hexanal
df$pollutant = "hexanal"
emis_chem(df, "CBMZ_MOSAIC")
# propadiene and NO2
df2 <- df1 <- df
df1$pollutant = "propadiene"
df2$pollutant = "NO2"
(dfe <- rbind(df1, df2))
emis_chem(dfe, "CBMZ_MOSAIC")
dfe$region <- rep(letters[1:2], 10)
emis_chem(dfe, "CBMZ_MOSAIC", "region")
emis_chem(dfe, "CBMZ_MOSAIC", "region", TRUE)

## End(Not run)

vein documentation built on May 29, 2024, 7:20 a.m.