temperature: QC for Air Temperature (TX/TN/TG)

Description Usage Arguments Value See Also Examples

View source: R/temperature.R

Description

This function will centralize temperature-like QC routines. It will QC files for temperature. Reads all the temperature data in the ./raw folder (TX, TN or TG) and quality controls each of them. Notice that ECA&D stores temperature in 1/10th of Celsius degrees when entering new parameter values

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
temperature(
  element = "TX",
  large = 500,
  small = -500,
  maxjump = 200,
  maxseq = 3,
  margina = 0.999,
  level = 4,
  window = 11,
  roundmax = 10,
  blockmanymonth = 15,
  blockmanyyear = 180,
  blocksizeround = 20,
  qjump = 0.999,
  tjump = 1.5,
  inisia = FALSE
)

Arguments

element

two-letters ECA&D code for the element ('TX' for daily maximum temperature, 'TN' for daily minimum temperature, 'TG' for daily mean temperature) passed as character string

large

value above which the observation is considered physically impossible for the region. Defaulted to 500. Passed on to physics(). See ?physics for details

small

value below which the observation is considered physically impossible for the region. Defaulted to -500. Passed on to physics(). See ?physics for details

maxjump

forcing for jumps2() in absolute mode (in the same units of the variable). Passed on to jumps2(). See ?jumps2 for further details

maxseq

maximum number of consecutive repeated values, for flat function (11.1,11.1,11.1 would be 3 consecutive values). Passed on to flat(). See ?flat for details

margina

tolerance margin, expressed as quantile of the differences, FUNCTION: newfriki(). Passed on to newfriki(). See ?newfriki for details

level

number of IQRs for IQRoutliers()

window

number of days to be considered (including the target), FUNCTION: IQRoutliers()

roundmax

maximum number of consecutive decimal part value, for flat function (10.0, 11.0, 12.0 would be 3 consecutive value). Passed on to flat()

blockmanymonth

maximum number of equal values in a month, FUNCTION: toomany()

blockmanyyear

maximum number of equal values in a year, FUNCTION: toomany()

blocksizeround

the maximum number of repeated values with the same decimal, FUNCTION: roundprecip()

qjump

quantile for jumps2() in quantile mode. Passed on to jumps2(). See ?jumps2 for further details

tjump

factor to multiply the quantile value for jumps2(). Passed on to jumps2(). See ?jumps2 for further details

inisia

logical flag. If it is TRUE inithome() will be called

Value

results of QC for TX/TN/TG

See Also

consolidator(), duplas(), flat(), IQRoutliers(), jumps2(), newfriki(), physics(), toomany(), rounding(), txtn(), weirdate()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#Set a temporal working directory:
wd <- tempdir()
wd0 <- setwd(wd)
#Create subdirectory where raw data files have to be located
dir.create(file.path(wd, 'raw'))
options("homefolder"='./'); options("blend"=FALSE)
#Extract the ECA&D data and station files from the example data folder
path2tnlist<-system.file("extdata", "ECA_blend_source_tn.txt", package = "INQC")
tnlist<-readr::read_lines_raw(path2tnlist)
readr::write_lines(tnlist,'ECA_blend_source_tn.txt')
path2tndata<-system.file("extdata", "TN_SOUID132733.txt", package = "INQC")
tndata<-readr::read_lines_raw(path2tndata)
readr::write_lines(tndata, file=paste(wd,'/raw/TN_SOUID132733.txt',sep=''))
#Perform QC of Air Temperature data
temperature(element='TN',inisia=TRUE)
#Remove some temporary files
list = list.files(pattern = "Rfwf")
file.remove(list)
#Return to user's working directory:
setwd(wd0)
#The QC results can be found in the directory:
print(wd)

INQC documentation built on May 24, 2021, 5:07 p.m.