2.3.3.emissions.calculations {pems.utils} | R Documentation |
Functions associated with emissions calculations.
calcEm(conc = NULL, time = NULL, calc.method = calcEmHoribaPitot, analyte = NULL, ..., data = NULL, fun.name = "calcEm", force = FALSE, this.call = NULL, hijack= FALSE) calcEmHoribaPitot(conc = NULL, time = "local.time", exflow = "exh.flow.rate", extemp = "exh.temp", express = "exh.press", analyte = NULL, delay = NULL, mm = NULL, ..., force = force, data = NULL, fun.name = "calcEmHoribaPitot", this.call = NULL, hijack= FALSE)
conc |
(Data series, typically vector) Analyte/species concentrations, the main input for
calculating emissions. If |
time, exflow, extemp, express |
(Data series, typically vectors) Other inputs used when calculating emissions. The
combination depending on the calcuation method used (and set by |
calc.method |
(Required function) The function to use to calculate emissions. (Default
|
analyte |
(Optional character vector) The analyte emissions are to be calculated for. If supplied,
this is used as a reference when assigning molecule weight and other analyte properties
if these are not provided as part of calculate call. If not supplied, |
... |
(Optional) Other arguments, currently passed on to function provided as
|
data |
(Optional |
fun.name, hijack, this.call, force |
(Various pems management functions) |
delay, mm |
(Optional numerics) Emissions calculation constants. |
calcEm...
functions calculate emissions.
calcEm
is a wrapper function which is intended to provide a conventient front for
emissions calculation methods. It accepts an input codeconc which it checks and passes
on to calc.method
, along with other supplied arguments.
calcEmHoribaPitot
calculates emissions using methods described in the Horiba OBS
Operators Manual. In addition to conc
, the function requires the time, and exhaust
flow data series (measured by the OBS Pitot flow meter). By default, the function assumes
that these are default names that are generated for these when standard OBS files are
imported into R
using the pems.utils
import function importOBS2PEMS
.
See References and Note below.
calcEmHoribaPitot
(and calcEm
by default) use Horiba Manual methods to
calculate emissions (in g/s).
calcEm...
constants can be set/modified in the calculation call, e.g.
calcEm(..., delay = [new.value])
. If not supplied, these are first checked for
in the associated pems
object (if supplied), or set to default values. See
References. If analyte-related constants are to be added to a pems
object,
these should be named in the format '[type].[analyte]', e.g. delay.co
for
the delay
constant to be used for the analyte CO.
Unit handling in pems.utils
is via checkUnits
, getUnits
,
setUnits
and convertUnits
. See common.calculations
for details.
hijack
is an in-development argument, supplied to allow code developers to run multiple
functions in different function environments. When developers 'mix and match' code from
several sources it can become unstable, especially if functions are run within functions within
functions, etc. hijack = TRUE
and associated code makes a function local to 'side-step'
this issue. This works by assuming/expecting all inputs to be local, i.e. supplied directly by
the code user.
Karl Ropkins
calcEmHoribaPitot
uses methods described in:
The Horiba Operators Manual.
See common.calculations
(and checkInput
, checkUnits
and
convertUnits
) for details of data management.
########### ##example 1 ########### #basic usage em.co <- calcEm(conc.co, data = pems.1) #where the returned object, em.co, is a pems.element