extract_NEON_fluxes: extract_NEON_fluxes

Description Usage Arguments Value Notes on median deviation filter Author(s)

View source: R/extract_NEON_fluxes.R

Description

Extracts NEON eddy covariance data from HDF5 files, merges with relevant meteorolgical data, and returns a data.frame for a specified time period. A specific year can be requested, though the default is to return the entire period of record for that site. Current setup assumes that you have a local copy of eddy covariance files (DP4.00200.001) for the site of interest. Meterological data *can* also be local, and a location specified by the met.path argument; if no value is provided to met.path, meteorological data for the site for the requested period will be retrieved from the NEON API. Calculates VPD from NEON-provided temp and RH. Clear spikes are removed using a moving "deviation from median" filter, described by Brock 1986 and shown to perform well in Starkenburg et al. 2016. Default options return a data.frame that is immediately useable for flux partitioning using REddyProc, though users are encouraged to verify that the despiking worked appropriately for their site. An option to save the returned data.frame, set by the arguments write.to.file == TRUE and out.path, is also available.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
extract_NEON_fluxes(
  neon.site,
  year = 9999,
  flux.path = "~/Dropbox/NEON/DP4_00200_001",
  met.path,
  expanded = FALSE,
  median.filter = TRUE,
  write.to.file = FALSE,
  out.path
)

Arguments

neon.site

Four letter code indicating NEON site.

year

Which year to process? If not specified, process all.

flux.path

Specify path to flux data you wish to process.

met.path

Specify path to meteorological data (if NULL - download from NEON API)

expanded

Return only the "standard" variables, or an expanded set? Expanded set includes individual components of SW/LW fluxes as well as PAR.

median.filter

Filter half-hourly data using the Brock 86 median filter.

write.to.file

Write to csv file?

out.path

If saving a file of results, where should it be saved?

Value

A data.frame containing merged eddy covariance and meteorological variables on a common time array. If expanded = FALSE, output will be exactly the input data.frame. required by REddyProc. If expanded = TRUE, output data.frame includes: a) storage and turblent terms of net flux, b) expanded radiation variables, including outgoing SW, incoming and outgoing LW, and PAR.

Notes on median deviation filter

This function by default applies a "median absolute deviation" filter to the net flux variables of sensible heat, latent heat, and net ecosystem exchange. The filter is applied to a moving window of data, currently 7 points, and each point in that window is compared to the median of the window. If it differs by the median by a certain threshold, the data point is discarded. Due to the width of the filter, only spikes smaller than 3 points can be removed. As a result, there is a second weak filter that removes points that are more than 4sigma from the mean. The threshold values in this filter are 10 umolCO2/m2/s for NEE, and 100 W/m2 for LH and H. All of these should be considered provisional, and different thresholds may be suggested. If you need different thresholds, or suggest they should be changed globally, contact me.

Author(s)

Rich Fiorella rich.fiorella@utah.edu


rfiorella/UUfluxproc documentation built on Nov. 22, 2020, 11:30 p.m.