spti_coverage | R Documentation |
Yearly estimates of spatial, temporal and spatio-temporal sampling coverage based on comparison of ideal vs observed number of samples in spatial and/or temporal bins.
spti_coverage(
df,
TimestampCol = "TIMESTAMP_START",
wdCol = "WD",
targetCol = "NEE_VUT_REF",
QcCol = "NEE_VUT_REF_QC",
plot = FALSE,
nInt = 8L,
year = NULL
)
df |
A data frame. |
TimestampCol |
A character string. Specifies a column name in |
wdCol |
A character string. Specifies a column name in |
targetCol |
A character string. Specifies a column name in |
QcCol |
A character string or |
plot |
A logical value. If |
nInt |
An integer value. A number of wind sectors and time intervals for binning. |
year |
Either integer vector, character string |
Arguments specifying df
column names represent FLUXNET standard. To
process REddyProc
outputs, timestamp must be corrected to represent
middle of averaging period and appropriate columns selected (see
Examples
).
Sampling coverage (SC) ranges from 0 (unilateral sampling) to 1 (fully
balanced sampling when all bins contribute evenly), i.e. SC close to 1 is the
most ideal. Note that SC = 1 - Gini
, where Gini
is Gini index
used as a measure of statistical dispersion. The dotted line showing
cumulative contribution of ranked observations in SC plots is also known as
Lorenz curve.
If plot = FALSE
, a data frame. If plot = TRUE
, a named
list of ggplot
objects.
Griebel, A., Metzen, D., Pendall, E., Burba, G., & Metzger, S. (2020). Generating spatially robust carbon budgets from flux tower observations. Geophysical Research Letters, 47, e2019GL085942. https://doi.org/10.1029/2019GL085942
Griebel20_budgets
and spti_boot
.
## Not run:
library(REddyProc)
# convert timestamp
DETha98 <- fConvertTimeToPosix(Example_DETha98, 'YDH', Year = 'Year',
Day = 'DoY', Hour = 'Hour')[-(2:4)]
# generate randomly wind directions for demonstration purposes (not included)
DETha98$WD <- sample(0:359, nrow(DETha98), replace = TRUE)
# if QcCol = NULL, all non-missing values of targetCol are used for budgeting
not_filled <- DETha98
not_filled$DateTime <- not_filled$DateTime - 900
spti_coverage(not_filled, "DateTime", "WD", "LE", NULL)
spti_coverage(not_filled, "DateTime", "WD", "LE", NULL, plot = TRUE)
# gap-filling is not needed but illustrates processing of FLUXNET data
# notice that ustar filtering of NEE should be applied before budgeting
DETha98 <- filterLongRuns(DETha98, "NEE")
EProc <- sEddyProc$new('DE-Tha', DETha98,
c('NEE', 'Rg', 'Tair', 'VPD', 'Ustar'))
EProc$sMDSGapFillAfterUstar('NEE', uStarTh = 0.3, FillAll = TRUE)
filled <- cbind(DETha98, EProc$sExportResults())
# correct timestamp to represent middle of averaging period
filled$DateTime <- filled$DateTime - 900
spti_coverage(filled, "DateTime", "WD", "NEE", "NEE_uStar_fqc")
spti_coverage(filled, "DateTime", "WD", "NEE", "NEE_uStar_fqc", plot = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.