2.3.3.emissions.calculations {pems.utils}R Documentation

Emission calculations

Description

Functions associated with emissions calculations.

Usage


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)

Arguments

conc

(Data series, typically vector) Analyte/species concentrations, the main input for calculating emissions. If conc is a concentration data series from a standard pems source it should be named conc.[analyte] and pems.utils will manage it accordingly. See below for further details.

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).

calc.method

(Required function) The function to use to calculate emissions. (Default calcEmHoribaPitot). See below for further details.

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, pems.utils attempts to recover these from available sources, e.g. data if supplied as part of the calculation call or package references such as ref.chem.

...

(Optional) Other arguments, currently passed on to function provided as calc.method (default calcEmHoribaPitot) and appropriate check... functions.

data

(Optional data.frame or pems object) The data source if either a data.frame or pems object is being used.

fun.name, hijack, this.call, force

(Various pems management functions) fun.name (character vector) the name of the parent function, to be used in error messaging. hijack (logical) Is this function being locally 'hijacked' by a user/function developer? See Note on hijack below. this.call the initial call (can generally be ignored) force (Logical) Should calcEm and calc.method ignore any error checking, e.g. units assignments, and do calculations anyway?

delay, mm

(Optional numerics) Emissions calculation constants. delay is the time delay between conc measurements and other timeseries. mm is the molecular mass of the analyte. If supplied, these in-call values supercede any preset values previously assigned to these constants, e.g. in the associated pems object or package look-up.tables.

Details

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.

Value

calcEmHoribaPitot (and calcEm by default) use Horiba Manual methods to calculate emissions (in g/s).

Note

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.

Author(s)

Karl Ropkins

References

calcEmHoribaPitot uses methods described in:

The Horiba Operators Manual.

See Also

See common.calculations (and checkInput, checkUnits and convertUnits) for details of data management.

Examples


###########
##example 1 
###########

#basic usage

em.co <- calcEm(conc.co, data = pems.1)

#where the returned object, em.co, is a pems.element


[Package pems.utils version 0.2.25.11 Index]