fluxx: Estimate (ghg) flux rates from online dynamic closed chamber...

View source: R/fluxx.R

fluxxR Documentation

Estimate (ghg) flux rates from online dynamic closed chamber measurements in through-flow mode.

Description

(Bulk) estimates of (ghg) fluxes from online concentration measurements with non-steady-state closed chambers. The function tries to find stable linear conditions in concentration change by fitting many regressions to the data and automatically detects and excludes rapid concentration fluctations.

Usage

fluxx(x, var.par, subset, asterisks = FALSE, loop = "auto", ...)

mf.flux(x, var.par, method = "r2", time.unit = "S", all.through = TRUE, iv = 1, 
wndw = 0.1, pdk = 0.5, min.dp = 20, nrmse.lim = 0.1, r2.qual = 0.9, 
range.lim = 5, out.unit = "auto", elementar = FALSE, 
hardflag = list(range = TRUE), consecutive = FALSE)

Arguments

x

A list of data tables as returned by chop or alternatively one data table (for mf.flux which will rarely be called directly by the user). Each table contains data for one chamber measurement. Minimum requirements are the columns specified in var.par.

var.par

A named list specifying the variables and parameters that are used in the estimation process and variables that should be handed through the function so that they are easily available for further analysis. Some of the names are obligatory (e.g. time, volume, area, t.air, p.air, and two or more that specify the gas column and the gas quality column), others are optional. See details and examples.

subset

An optional vector specifying a subset of concentration measurements to be used in the estimation process.

asterisks

Logical. If TRUE p-values are given as asterisks and other symbols (p<.001 = "***", .001<p<.01 = "**", .01<p<.05 = "*", .05<p<.1 = ".", p>=.1 == " ").

loop

Can be TRUE, FALSE or "auto". Determines how bulk flux estimations are done. If TRUE a for-loop is used, if FALSE lapply is used, and if "auto" the approach is switched automatically depending on the number of data tables: If x contains more than 100 data tables (chamber placements) the approach is switched from lapply to for-loop because lapply may be slow on large x.

...

Further arguments passed to mf.flux.

method

Character string specifying the statistic used for finding the linear part. Partial match to "r2", "rmse", "AIC". Defaults to "r2". See Details.

time.unit

Single character giving the appropriate unit of time elapsed between two concentration measurements. Will typically be seconds, thus default is "S". Other options are "M" for minutes and "H" for hours. ATTENTION: Setting the time unit to the wrong value will result in incorrect fluxes.

all.through

Logical. When TRUE, all data columns in x other than the ones needed for flux calculation are also handed through the function so that they can be used in later steps of analysis. You may also specify one or several columns that are handed through using var.par. The all.through setting overruns the var.par settings.

iv

Numeric. Sometimes there is no time information at all but the rows in x are just numbered consecutively. The correct temporal spread is calculated inside the function when the measurement interval is specified here. Defaults to 1 which expects times to be correctly given in x.

wndw

Numeric between 0 and 1. Relative width of a moving window in which the standard deviation of the concentrations is calculated to identify high frequency fluctuations. See details and next.

pdk

Numeric between 0 and 1. Minimum proportion of data points to be kept. See details. In case one single concentration value occurs more than pdk * n times in the data (may happen under zero to very low flux conditions), all other data is assumed to represent high frequency fluctuations and flux is set to zero.

min.dp

Numeric. The minimum number of data points. Defaults to 20. If there are less rows the estimation is run anyway but a warning is issued and min.dp is automatically adjustet to n-1.

nrmse.lim

The maximum acceptable normalized root mean square error. Numeric value between 0 and 1. Defaults to 0.1. If the final best solution has a higher nrmse it is flagged accordingly.

r2.qual

Numeric between 0 and 1. Quality parameter for the model fit. The minimum acceptable R2 of the best fitted model. Defaults to 0.8. When the value is below quality setting a quality flag is reported.

range.lim

Numeric. The minimum range of the concentration measurements during one chamber placement. The acceptable range limit depends on the accuracy of the concentration measurements. When the range of the concentration measurements is smaller than the repeatability range of the measurement device one cannot tell real increase in concentration from random fluctuation. Therefore, if the range of the concentration measurements during one chamber placement is < range.lim, the range.flag is set to FALSE (0). See details.

out.unit

Character string determining the output unit of the flux rate mass part. The default "auto" tries to find a unit that ranges the output value between 0.01 and 10. Possible output units are "ng", "mug", "mg", or "g". "mug" stands for "μg" because non-ascii characters are not allowed in functions. Beware of varying mass units in your output when running in auto mode.

elementar

When the fluxes are wanted as element values set elementar = TRUE. Defaults to FALSE.

hardflag

Named list that controls which of the quality flags are to be hard flagged (the value is changed according to the quality flag). Only range.lim is hard flagged by default. So when the range of concentration values for a chamber measurement is smaller than the set range limit a zero flux is returned. When a flux estimation does not meet the quality requirements of any other hard-flagged quality parameter fluxx returns NA. For changing a quality flag to a hard flag just provide its name (without quotation marks) and set it to TRUE. Possible parameters to choose as hard or soft flag are nrmse, range, and r2. Further the number of measurements below ambient (nomba) can be hardflagged by setting nomba = [0…nc] with nc = number of concentration measurements for one chamber placement.

consecutive

Shall the most linear part be found by a consecutive approach starting at the first concentration reading. As soon as a stable flux is detected, it is stored. Strictly experimental.

Details

The function is similar to flux but uses a different algorithm to identify the most linear part of the concentration development. First high frequency fluctations are omitted. Then all possible pdk * n : n consecutive concentration measurements are regressed against the corresponding times. The model with the highest r2 is chosen.

var.par specifies the variables within x and fixed parameters for all chamber placements that are used for the flux estimations. For obligatory var.par items see flux and examples. In contrast to flux there is just one workhorse function doing the actual estimation (mf.flux) per data table. Especially when there are many data tables in x and/or many data points per data table it takes some time. Progress is shown in the console. Each dot represents one finalized data table.

Value

fluxx returns a complex object of class fluxxes that is a 2 entry list. When the object is printed to the console only the second entry is displayed in a modified form that is meant to maximize information display with small footprint for easy inspection. A table is printed to the console with three columns per gas. The first contains the quality flags (e.g. 111.9). The order is: r2.f, range.f,nrmse.f, nomba.f. The first three are considered more important, and if they are '1' everything is fine. The last number digit following the full stop gives the number of concentration readings below ambient.

The data.frame with the estimated flux rates contains all data needed for further analysis. The columns represent the entries in fluss of the single chamber measurements (including quality flags, see below) plus naming information according to the settings in the nmes argument of chop. export provides a simple way to export the results.

The first entry is itself a list of lists and data tables. It is called flux.res. The only one first level entry in this list contains the information for one gas which is itself a list. In this list each first level entry contains the information for one chamber measurement. It is named according to the nmes-setting in chop and contains the elements fluss (which is itself a list with the elements given below), mod, out (a list with hand through data, list items according to columns in x that have been handed trough via all.through or var.par), and inn - a data.frame with the input data that were relevant for estimating the flux (the obligatory part of var.par).

The elements of fluss:

ghg

Character. The gas species for which the flux has been estimated.

flux

Numeric. Calculated flux rate in mass unit per m2 and hour.

r2

r2 of the best fitted model that has been used for flux caclulation.

nrmse

nrmse of the best fitted model that has been used for flux calculation.

r2.f

Logical. r2 quality flag telling whether the r2 quality setting given in r2.qual is fulfilled.

range.f

Logical. Range quality flag telling whether the range of the concentration measurements exceeded the quality range of the measurement device that has been specified in range.lim.

nrmse.f

Logical. nrmse quality flag telling whether the nrmse quality setting given in nrmse.lim is fulfilled (i.e. if the nrmse of the best model <= nrmse.lim).

nomba.f

Integer. Reports the number of measurements below ambient. When one observes concentrations below ambient that might make the measurements unstable, it is possible to filter the results later and allow only a maximum acceptable number of measurements below ambient. The ambient concentration is build into the function with data from Mace Head Ireland (N2O, CH4) and global average (CO2) obtained from http://cdiac.ornl.gov/pns/current_ghg.html as of August 1st, 2011.

unit

The mass unit assigned.

podpu

Proportion (expressed as a number between 0 and 1) of data points used for constructing the linear model for estimating the flux rate. The higher the less disturbed the measurements.

Author(s)

Gerald Jurasinski, gerald.jurasinski@uni-rostock.de

References

Nakano T (2004) A comparison of regression methods for estimating soil-atmosphere diffusion gas fluxes by a closed-chamber technique. Soil Biology and Biochemistry 36: 107-113.

Forbrich I, Kutzbach L, Hormann A, Wilmking M (2010) A comparison of linear and exponential regression for estimating diffusive CH4 fluxes by closed-chambers in peatlands. Soil Biology and Biochemistry 42: 507-515.

See Also

gpp and reco for further processing of the results.

Examples

## Not run: 
## load data
data(tt.nee)

## prepare flux estimation
# make parts with chop
tt.parts <- chop(tt.nee, factors=c("session", "spot"), 
nmes=c("spot", "date", "session"), min.cm=40)
# prepare var.par list (like with flux)
vp <- list(CO2 = "NEE", time = "datetime", area = "area", 
volume = "volume", t.air = "t.cham", p.air = 101325)

## do the flux estimation
# run fluxx. with lots of data it may take a while 
# (approx. 10 sec per chamber)
tt.flux <- fluxx(tt.parts, subset=c(1:30), vp, pdk=0.5, 
range.lim=3, out.unit="mg")
# inspect results table
tt.flux
# plot diagnostic plots
plot(tt.flux, dims=c(4,4), subs="spot")
# run fluxx with alternative method
tt.fluxa <- fluxx(tt.parts, subset=c(1:30), vp, pdk=0.5, 
range.lim=3, out.unit="mg", method="rmse")
# inspect results
tt.fluxa

## End(Not run)

flux documentation built on June 26, 2022, 9:05 a.m.