amf_filter_baseR Documentation

Filter AmeriFlux BASE data based on plausible range

Description

The function filters BASE data based on the expected plausible ranges specified for each variable. See AmeriFlux web site https://ameriflux.lbl.gov/data/data-processing-pipelines/data-qaqc/ for description of the plausible ranges.

Usage

amf_filter_base(
  data_in,
  limit_ls = NULL,
  basename_decode = NULL,
  loose_filter = 0.05
)

Arguments

data_in

A data frame containing BASE data, e.g., import from amf_read_base.

limit_ls

A data frame with at least three columns:

  • Name: variable base name

  • Min: expected lower bound

  • Max: expected upper bound

If not specified, use amf_variables by default.

basename_decode

A data frame with at least two columns:

  • variable_name: actual variable name

  • basename: variable base name

If not specified, use amf_parse_basename by default.

loose_filter

A number in ratio (0-1) used to adjust the physical range for filtering. Set it to 0 if not used. The default is 0.05.

Value

A data frame similar to data_in filtered out off-range points

Examples

## Not run: 
# read the BASE from a csv file
base <- amf_read_base(file = system.file("extdata",
                                         "AMF_US-CRT_BASE_HH_2-5.csv",
                                          package = "amerifluxr"),
                      unzip = FALSE,
                      parse_timestamp = FALSE)

# filter data, using default physical range +/- 5% buffer
base_f <- amf_filter_base(data_in = base)

# filter data, using default physical range without buffer
base_f <- amf_filter_base(data_in = base, loose_filter = 0)

## End(Not run)