#########################################
# config.R                              #
# Load the quality control software     #
# suite and auxiliary functions         # 
# Assing a number to each flag          #
# jramon - November 2018                #
#########################################
library(data.table)
library(lubridate)
library(zoo)
library(ggplot2)
library(gridExtra)
library(scales)

#----------------------------------------
# Auxiliary functions
#----------------------------------------
source('./R/qc_tests.R')
source('./R/temporal_series.R')
source('./R/times_functions.R')
source('./R/circular_avgs.R')
source('./R/resize_time_stamps.R')

#----------------------------------------
# Flags assigned according to QARTDOD: Manual for Real-Time Quality Control of Wind Data. Page 12
# qc_values: List containing the flags assigned to each observation depending on whether they pass each test or not
#   0: not evaluated by the QC test
#   1: pass
#   2: suspect, could need further check
#   4: fail
#   5: calm, wind speed under 0.5 m s-1
#   9: missing
#----------------------------------------
qc_values <- list()
qc_values$pass <- 1
qc_values$not.eval <- 0
qc_values$suspect <- 2
qc_values$fail <- 4
qc_values$calm <- 5
qc_values$missing <- 9

