QCthresholds {climatol} | R Documentation |
Obtain monthly thresholds for Quality Control alerts
Description
This function calculate monthly quantiles of daily or subdaily series that can be used as thresholds for Quality Control alerts.
Usage
QCthresholds(dat, ndec=1, probs=c(0.,.001,.01,.99,.999,1.), minval=NA,
maxval=NA, homog=TRUE, verb=TRUE)
Arguments
dat |
Either the name of a *.rda file of |
ndec |
number of decimals of output values [1] (defaults shown between brackets) |
probs |
probabilities of the quantiles to be computed [0., .001, .01, .99, .999, 1.] |
minval |
minimum value to compute runs of constant values [ |
maxval |
maximum value to compute runs of constant values [ |
homog |
use homogenized data if a *.rda file is used as input [ |
verb |
list all calculated values? [ |
Details
minval
and maxval
allow to exclude frequent values that would
result in the report of long runs of identical data. Examples: set
minval=0.1
in daily precipitation to avoid long runs of zeros or set
maxval=97
in relative humidity to avoid long runs of near saturation
values in episodes of persistent fog.
Calculated thresholds are shown in the text output and are also saved in a
binary R file named QCthresholds.Rdat
, which contains the matrices
thr1
, thr2
and thr3
. Load this file and write the
thresholds in the required format for importation into a Climate Data
Management System.
See Also
Examples
## Set a temporal working directory and write input files:
wd <- tempdir()
wd0 <- setwd(wd)
data(climatol_data)
## Now run the examples:
QCthresholds(RR3st,minval=0.1) #daily precipitation of three stations
QCthresholds(TX3st) #daily maximum temperatures of three stations
load('QCthresholds.Rdat') #load last calculated thresholds
thr1[1,,] #thresholds with 0% probability to find lower values
thr1[,3,] #monthly thresholds of the third station
thr2 #thresholds of absolute increments between consecutive data
thr3 #thresholds for equal data run lengths
## Return to user's working directory:
setwd(wd0)
## Input and output files can be found in directory:
print(wd)