Function for reading observational GPP data from FLUXNET dataset and defining calibration target (which flux decomposition method etc.)

get_obs_bysite_fluxnet(
  sitename,
  dir,
  dir_hh = NULL,
  dir_hr = NULL,
  timescale,
  getvars,
  getswc = TRUE,
  threshold_GPP = 0,
  threshold_LE = 0,
  threshold_H = 0,
  threshold_SWC = 0,
  threshold_WS = 0,
  threshold_USTAR = 0,
  threshold_T = 0,
  threshold_NETRAD = 0,
  filter_ntdt = FALSE,
  return_qc = FALSE,
  remove_neg = FALSE,
  verbose = TRUE
)

Arguments

sitename

A character string specifying the site name for which FLUXNET data is searched (based on the site name appearing as part of the respective file name). Defaults to NA.

dir

A character string specifying the local path of FLUXNET data.

dir_hh

A character string specifying the local path of half-hourly FLUXNET data, required to get daytime VPD and daily minimum temperature. Defaults to NULL (no daytime VPD or daily minimum temperature is calculated).

dir_hr

A character string specifying the local path of hourly FLUXNET data, required to get daytime VPD. Defaults to NULL (no daytime VPD is calculated).

timescale

A character specifying the time scale of FLUXNET data. Any of c("d", "w", "m", "y") for daily, weekly, monthly, or yearly, respectively.

getvars

A vector of character strings corresponding to the FLUXNET variable names as used in the original data files. See https://fluxnet.fluxdata.org/data/fluxnet2015-dataset/. If argument getswc==TRUE, then soil water content data (variables starting with SWC_) are read.

getswc

include soil water content (TRUE/FALSE, default = TRUE)

threshold_GPP

A numeric value (between 0 and 1 for daily, weekly, monthly, and annual data or 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data). The value specifies the threshold for excluding data during data cleaning. The threshold is with respect to the data quality flag in the FLUXNET data, indicating the fraction of measured and good quality gapfilled data for daily, weekly, monthly, and annual data and 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data. Defaults to threshold_GPP=0 meaning no data is excluded.

threshold_LE

A numeric value (between 0 and 1 for daily, weekly, monthly, and annual data or 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data). The value specifies the threshold for excluding data during data cleaning. The threshold is with respect to the data quality flag in the FLUXNET data, indicating the fraction of measured and good quality gapfilled data for daily, weekly, monthly, and annual data and 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data. Defaults to threshold_GPP=0 meaning no data is excluded.

threshold_H

A numeric value (between 0 and 1 for daily, weekly, monthly, and annual data or 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data). The value specifies the threshold for excluding data during data cleaning. The threshold is with respect to the data quality flag in the FLUXNET data, indicating the fraction of measured and good quality gapfilled data for daily, weekly, monthly, and annual data and 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data. Defaults to threshold_GPP=0 meaning no data is excluded.

threshold_SWC

A numeric value (between 0 and 1 for daily, weekly, monthly, and annual data or 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data). The value specifies the threshold for excluding data during data cleaning. The threshold is with respect to the data quality flag in the FLUXNET data, indicating the fraction of measured and good quality gapfilled data for daily, weekly, monthly, and annual data and 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data. Defaults to threshold_GPP=0 meaning no data is excluded.

threshold_WS

A numeric value (between 0 and 1 for daily, weekly, monthly, and annual data or 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data). The value specifies the threshold for excluding data during data cleaning. The threshold is with respect to the data quality flag in the FLUXNET data, indicating the fraction of measured and good quality gapfilled data for daily, weekly, monthly, and annual data and 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data. Defaults to threshold_GPP=0 meaning no data is excluded.

threshold_USTAR

A numeric value (between 0 and 1 for daily, weekly, monthly, and annual data or 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data). The value specifies the threshold for excluding data during data cleaning. The threshold is with respect to the data quality flag in the FLUXNET data, indicating the fraction of measured and good quality gapfilled data for daily, weekly, monthly, and annual data and 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data. Defaults to threshold_GPP=0 meaning no data is excluded.

threshold_T

A numeric value (between 0 and 1 for daily, weekly, monthly, and annual data or 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data). The value specifies the threshold for excluding data during data cleaning. The threshold is with respect to the data quality flag in the FLUXNET data, indicating the fraction of measured and good quality gapfilled data for daily, weekly, monthly, and annual data and 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data. Defaults to threshold_GPP=0 meaning no data is excluded.

threshold_NETRAD

A numeric value (between 0 and 1 for daily, weekly, monthly, and annual data or 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data). The value specifies the threshold for excluding data during data cleaning. The threshold is with respect to the data quality flag in the FLUXNET data, indicating the fraction of measured and good quality gapfilled data for daily, weekly, monthly, and annual data and 0 [measured], 1 [good quality gapfill], 2 [ medium], 3 [poor] for half-hourly data. Defaults to threshold_GPP=0 meaning no data is excluded.

filter_ntdt

A logical specifying whether agreement of daytime and nighttime-based GPP estimates is to be used as a filter. Data points are removed where their difference is below the the 97.5 above the 2.5 Defaults to FALSE.

return_qc

A logical specifying whether quality control variables should be returned.

remove_neg

A logical specifying whether negative GPP values are to be removed (replaces with NA).

verbose

verbose output

Value

A data frame (tibble) containing cleaned observational data, named and in units corresponding to rsofun standard.

Examples

if (FALSE) { # \dontrun{
df <- get_obs_bysite_fluxnet
} # }