tdm_damp: Signal dampening correction

Description Usage Arguments Value References Examples

View source: R/tdm_damp.R

Description

When long-term K time series (~3 years) are provided, one can perform a signal dampening correction (when sensors were not re-installed; see Peters et al. 2018). Applying the signal dampening correction requires visually inspecting the correction curve (see make.plot = TRUE). The correction curve is constructed with the day since installation and the day of year (DOY) to account for seasonal changes in K values. The function returns corrected K values and the applied correction curve.

Usage

1
tdm_damp(input, k.threshold = 0.05, make.plot = TRUE, df = FALSE)

Arguments

input

An is.trex-compliant object (zoo vector, data.frame) of K values containing a timestamp and a value column.

k.threshold

Numeric, the threshold below which daily maximum K values should not be considered (default = 0.05).

make.plot

Logical; if TRUE, a plot is generated presenting the correction curve and the K time series.

df

Logical; If TRUE, output is provided in a data.frame format with a timestamp and a value column. If FALSE, output is provided as a zoo vector object (default = FALSE).

@details The function fits a correction curve for signal dampening (e.g., due to wounding) according to Peters et al. (2018). A sensor specific function is fitted to daily maximum K values (considering a minimum cut-off threshold; see k.threshold). Dependent variables for the function include seasonality (DOY) and days since installation (t). First, seasonal effects are removed by correcting the K series (residuals; Kresid) to a second-order polynomial with DOY. These residuals are then used within a non-linear model:

Kresid = (a + b * t)/(1 + c * t + d * t2)

The fitted parameters for t (with a, b, c and d) are used to correct K and scale it to the maximum within the first year of installation. Note, that the stability of the fit has to be visually inspected before using the output data.

Value

A zoo object or data.frame in the appropriate format for other functionalities. See tdm_dt.max output specifications. All K values for each method are provided when an is.trex-object was used as input. If an individual time series was provided for input with K values an alternative output is given:

k.cor

corrected K values according to the correction curve.

k

K values provided as input.

damp.mod

data.frame with the coefficients of the correction curve.

References

Peters RL, Fonti P, Frank DC, Poyatos R, Pappas C, Kahmen A, Carraro V, Prendin AL, Schneider L, Baltzer JL, Baron-Gafford GA, Dietrich L, Heinrich I, Minor RL, Sonnentag O, Matheny AM, Wightman MG, Steppe K. 2018. Quantification of uncertainties in conifer sap flow measured with the thermal dissipation method. New Phytologist 219:1283-1299 doi: 10.1111/nph.15241

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 #correct for dampening of the signal
raw   <-
  is.trex(
    example.data(type = "doy"),
    tz = "GMT",
    time.format = "%H:%M",
    solar.time = TRUE,
    long.deg = 7.7459,
    ref.add = FALSE
  )
input <-
  dt.steps(
    input = raw,
    time.int = 15,
    max.gap = 60,
    decimals = 6,
    df = FALSE
  )
input[which(input < 0.2)] <- NA
input <-
  tdm_dt.max(
    input,
    methods = c("pd", "mw", "dr"),
    det.pd = TRUE,
    interpolate = FALSE,
    max.days = 10,
    df = FALSE
  )
output.data <- tdm_damp(input,
                    k.threshold = 0.05,
                    make.plot = TRUE,
                    df = FALSE)
str(output.data)
head(output.data[["k.dr"]])
plot(output.data[["k.dr"]], ylab = expression(italic("K")))

TREXr documentation built on March 24, 2021, 5:06 p.m.