glimmr is an R package that makes it easier to process and handle data from dynamic flux measurements and provides functions to use with the boundary layer Equation (BLE).
During applications of dynamic chambers, typically two kinds of datasets are created: One continous dataset, provided by the gas analyzer, containing the gas mixing ratios and one metadataset with information about the single chamber applications. Typically this contains an ID of the spot location, time of the measurement start (and end) and maybe the chamber temperature.
glimmr reads both datasets, slices the concentration data into chunks defined by the metadata and fits linear and robust linear models (robust::lmRob
) for the actual flux calculation.
The datastructure of the recorderd data can be widely defined, hence glimmr is not restriced to a speceific device. Nevertheless, wrapper functions are included for GASMET and LosGatos gas analizers.
GASMET and LosGatos records can be directly loaded:
gasmet <- read_gasmet("path/to/gasmet_file.csv")
losgatos <- read_losgatos("path/to/losgatos/dir")
losgatos <- read_losgatos("path/to/losgatos_file.txt")
Single LosGatos files, as well as directories containing zips and txt files are supported. See read_losgatos()
for details.
The structure of corresponding metdata is defined as follows:
meta_gasmet
#> # A tibble: 6 x 5
#> plot date start temp offset
#> <chr> <date> <chr> <dbl> <chr>
#> 1 plotA 2017-04-12 09:01:49 6.9 0:0
#> 2 plotA 2017-04-12 09:08:56 6.9 0:0
#> 3 plotA 2017-04-12 09:14:25 6.9 0:0
#> 4 plotB 2017-04-12 16:47:41 6.3 0:0
#> 5 plotB 2017-04-12 16:55:41 6.3 0:1
#> 6 plotB 2017-04-12 17:02:20 6.3 0:0
meta_losgatos
#> # A tibble: 1 x 7
#> plot date start end t_start t_end offset
#> <chr> <date> <chr> <chr> <dbl> <dbl> <chr>
#> 1 plotA 2018-05-23 07:08:00 07:13:00 20 22 0:0
To use any arbitrary device all columns containing used information need to be defined.
# setup analyzer
custom_analyzer <- analyzer(
#define datastructure
time_stamp = "Time",
conc_columns = c(CH4 = "[CH4]_ppm", CO2 = "[CO2]_ppm"),
pressure = "GasP_torr",
pressure_factor = 1.33322,
temperature = "AmbT_C",
trimmer = trim_time,
# define metadata structure
plot = "plot",
date = "date",
start = "start",
end = "end",
#define chamber dimensions
V = 0.01461,
A = 0.098
)
# compute fluxes
process_chamber(
# specify data
data = losgatos,
meta = meta_losgatos,
#specify analyzer
analyzer = custom_analyzer
)
For simplification, GASMET and LosGatos can be called via convenient wrapper functions:
While the start of single measurements is (usually) defined by a known point in time, the end can be defined in different ways. See process_chamber()
for details.