
Frequency-aware quality control of air-temperature time series
tempQC.RdDetects the sampling frequency of a numeric zoo object with
sfreq and dispatches it to tempQC_daily or
tempQC_subdaily. No files are written.
Arguments
- x
A numeric
zooobject. Each column is one station.- metadata, station.id, coords, elevation, elevation.scale
Optional station metadata, field-name selectors, and elevation-decay control passed to the selected workflow. See
tempQC_daily.- ...
Arguments passed unchanged to the selected workflow. Because the daily and sub-daily functions have resolution-specific arguments, only arguments accepted by the detected workflow should be supplied. This includes
max.suspicious, the maximum proportion of finite observations that may be confirmed as suspicious before a station is recommended for discard; seetempQC_dailyandtempQC_subdaily.- max.candidates, selection.samples
Candidate and time-sample bounds passed to the selected workflow. See
tempQC_daily.- verbose
Logical. If
TRUE, informative messages report the detected frequency, parallel workers/nodes, active QC stages, and final QC summary. IfFALSE, these informational messages are suppressed; warnings and errors are unaffected.- ncores
Positive integer giving the total requested number of worker R processes, across all machines rather than per machine. The effective number is capped at the number of station columns.
ncores=1Luses the serial path and does not create a cluster. SeetempQC_daily.- parallel.type
Parallel backend passed to the selected workflow:
"socket","fork", or"serial". Network hosts can be used only with"socket". SeetempQC_daily.- cluster.nodes
NULLto place all socket workers on the local machine, or a character vector of host names on which PSOCK workers will be started. This argument selects worker locations; it does not set their number. Host names are recycled to the effectivencores. SeetempQC_daily.- from, to
Starting and ending index bounds used to subset
xbefore frequency detection and QC. SeetempQC_daily.
Details
Daily input is sent to tempQC_daily; minute or hourly input is sent to
tempQC_subdaily. Other frequencies are rejected explicitly. Automatic
dispatch changes only the workflow: test activation, thresholds, metadata,
correction policy, and station recommendation criteria remain under user
control. Progress is reported with message(), so it can be captured or
suppressed independently of the returned result. The staged design follows the
gross-error, tolerance, temporal,
inter-variable, and inter-station QC categories described by Brunet et al.
(2020).
The default ncores=1L is serial and preserves the historical behaviour.
When checks is not supplied through ..., spatial QC is enabled
by default only when metadata is supplied.
Spatial QC caches compact geographic/elevation candidate lists and symmetric
pair statistics, uses vectorized sufficient-statistic regressions, and
processes station-time prediction calculations in bounded row blocks. With a
PSOCK backend, large read-only data are broadcast once per worker. Setting
max.candidates=Inf or selection.samples=Inf requests the
corresponding exhaustive legacy-style selection.
Value
An object of class "tempQC"; see tempQC-class.
References
Brunet, M. et al. (2020). Best Practice Guidelines for Climate Data and Metadata Formatting, Quality Control and Submission. Copernicus Climate Change Service.
Examples
dates <- as.Date("2020-01-01") + 0:29
x <- zoo::zoo(cbind(A=10 + sin(seq_along(dates)),
B=11 + sin(seq_along(dates))), dates)
qc <- tempQC(x, checks=c(range=TRUE, duplicate=FALSE,
climatology=FALSE, persistence=FALSE,
step=FALSE, spike=FALSE, spatial=FALSE,
breakpoint=FALSE), min.years=0)
#> [tempQC] Detected daily data; dispatching to tempQC_daily() ...
#> [tempQC] Starting daily QC for 30 observations at 2 station(s) ...
#> [tempQC] Using serial backend with 1 worker(s) across 1 node(s): runnervm0hi8g.
#> [tempQC] Running physical-range check ...
#> [tempQC] Combining evidence and station recommendations ...
#> [tempQC] Completed daily QC: 2 accepted, 0 discarded; 0 flagged observation(s), 0 confirmed rejection(s).
qc$station.summary
#> station expected observed missing.percent review.count review.percent
#> A A 30 30 0 0 0
#> B B 30 30 0 0 0
#> suspicious.count suspicious.percent breakpoint.year breakpoint.indicator
#> A 0 0 NA <NA>
#> B 0 0 NA <NA>
#> breakpoint.p.value breakpoint.relative.change breakpoint.n.indicators
#> A NA NA 0
#> B NA NA 0
#> breakpoint.flag record.years recommendation reason
#> A FALSE 0.08213552 accept within acceptance limits
#> B FALSE 0.08213552 accept within acceptance limits
#> suspicious.tests
#> A <NA>
#> B <NA>