proc_dendro_L2: Clean Time-aligned Dendrometer Data

Description Usage Arguments Details Value References Examples

View source: R/proc_dendro_L2.R

Description

proc_dendro_L2 cleans time-aligned (L1) dendrometer data by removing outliers and correcting for erroneous jumps or shifts in the data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
proc_dendro_L2(
  dendro_L1,
  temp_L1 = NULL,
  tol_out = 10,
  tol_jump = 50,
  lowtemp = 5,
  frost_thr = 5,
  interpol = NULL,
  frag_len = NULL,
  plot = TRUE,
  plot_period = "full",
  plot_show = "all",
  plot_export = TRUE,
  plot_name = "proc_L2_plot",
  iter_clean = 1,
  tz = "UTC"
)

Arguments

dendro_L1

data.frame with time-aligned dendrometer data. Output of function proc_L1.

temp_L1

data.frame with time-aligned temperature data. Output of function proc_L1 (see Details for further information).

tol_out

numeric, defines the rigidity of the threshold above or below which a value is classified as an outlier. Lower values increase the rigidity (see Details for further information).

tol_jump

numeric, defines the rigidity of the threshold above or below which a value is flagged for jump correction. Lower values increase the rigidity (see Details for further information).

lowtemp

numeric, specifies the temperature in °C below which frost shrinkage or expansion is expected. Default value is set to 5°C due to hysteresis shortly before or after frost events.

frost_thr

numeric, increases the thresholds for outlier and jump detection in periods of probable frost (i.e. temperature < lowtemp). The thresholds are multiplied by the value provided.

interpol

numeric, length of gaps (in minutes) for which values are linearly interpolated after data cleaning. Set interpol = 0 to disable gapfilling. If interpol = NULL the default value is set to interpol = 2.1 * reso (i.e. two timestamps).

frag_len

numeric, specifies the length of data fragments occurring in-between missing data that are automatically deleted during data cleaning. This can be helpful to remove short fragments of erroneous data within a period of missing data, i.e. after jumps. If frag_len = NULL the default value is set to frag_len = 2.1.

plot

logical, specify whether the changes that occurred during data cleaning should be plotted.

plot_period

character, specify whether plots should be displayed for the whole period (plot_period = "full"), separately for each year (plot_period = "yearly") or for each month (plot_period = "monthly").

plot_show

character, specify whether all periods should be plotted (plot_show = "all") or only those periods in which L1 dendrometer data changed during data cleaning (plot_show = "diff").

plot_export

logical, specifies whether the plots are exported as a PDF file to the working directory or are plotted in the console.

plot_name

character, specify name of the PDF to which the plots are saved.

iter_clean

numeric, specifies the number of times the cleaning process is repeated. Can be used to check whether running the cleaning process multiple times has an effect on the results. In most cases, a single iteration is sufficient.

tz

specify the desired time zone. Default is "UTC".

Details

Time-aligned temperature data temp_L1 is used to define periods in which frost shrinkage is probable, e.g. when the temperature is below lowtemp. Without temperature data, frost shrinkages may be classified as outliers. For more details and an example see the following vignette: vignette("Introduction-to-treenetproc", package = "treenetproc").

Temperature data can also be provided along with dendrometer data. In this case, the name of the temperature series has to contain the string "temp". In case no temperature dataset is specified, a sample temperature dataset will be used with a warning. The sample temperature dataset assigns permanent frost to the three months December, January and February.

Outliers and jumps are identified when exceeding a lower or upper threshold. Thresholds are obtained on the basis of density distributions of differences between neighbouring data points. The rigidity of the thresholds can be controlled with the arguments tol_jump and tol_out. For more information on the calculation of the thresholds the user is referred to Knüsel et al. (2020, in prep).

Value

The function returns a data.frame with processed dendrometer data containing the following columns:

series

name of the dendrometer series.

ts

timestamp with format %Y-%m-%d %H:%M:%S.

value

dendrometer value (µm).

max

highest measured value up to this timestamp (µm).

twd

tree water deficit (µm), i.e. the amount of stem shrinkage expressed as the difference between max and value.

gro_yr

growth since the beginning of the year (µm). Also calculated for years with missing data.

frost

indicates frost periods (i.e. periods in which the temperature is below lowtemp).

flags

character vector specifying the changes that occurred during the processing. For more details see the following vignette: vignette("Introduction-to-treenetproc", package = "treenetproc")

version

package version number.

References

Knüsel S., Haeni M., Wilhelm M., Peters R.L., Zweifel R. 2020. treenetproc: towards a standardized processing of stem radius data. In preparation.

Examples

1
2
proc_dendro_L2(dendro_L1 = dendro_data_L1, plot_period = "monthly",
               plot_export = FALSE)

treenet/treenetproc documentation built on June 16, 2021, 4:39 p.m.