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.
amf_filter_base(
data_in,
limit_ls = NULL,
basename_decode = NULL,
loose_filter = 0.05
)
A data frame containing BASE data, e.g.,
import from amf_read_base
.
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.
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.
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.
A data frame similar to data_in
filtered out off-range points
if (FALSE) {
# 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)
}