Skip to content
Cristian Lussana edited this page Mar 24, 2021 · 8 revisions

Test based on the statistics of the deviations between observations and background (or first-guess) fields in a circular region around each observation. Bad observations are those that deviate too much with respect to the statistics computed through the neighbours.

Returned values are: the p-vector of the quality flags

flag description
-999 missing flag (observation not checked)
0 good observation
1 bad observation
11 isolated observation, it is the only observation inside the inner circle
12 isolated observation, less than num_min_outer observations inside outer circle

The constants to keep in mind are:

  • M, the number of observation providers
  • B, the number of background fields (see --fg.files)
  • N, the total number of tests. Each test is applied to just one background field. The N-vector fgt_fglab.fg matches the tests with the background fields. Example: fgt_fglab.fg equals to (1,1,2), then: three tests are defined; the first two tests will make use of the first background file; the third test will make use of the second background field. The order of the background fields is given by the input order in fg.file

The list of parameters is (type vector = it is possible to specify a sequence of buddy checks):

parameter description type
fgt do it, true or false logical
fgt.code code identifying bad observation flagged by the test scalar
i.fg number of repetitions of the entire sequence of checks scalar
break.fg break the loop over the tests if less than this number of observations has been flagged scalar
transf.fg transform values before doing the check scalar
doit.fg specify on a provider basis if the observations have to be tested (0=no; 1=yes) M-vector
prio.fg specify on a provider basis the priorities the observations have (the smaller the number, the higher the piority) M-vector
fgt_fglab.fg labels identifying which of the background fields have to be used in the test N-vector
circle_radius.fg radius (m) of the circle N-vector
tpos.fg threshold when the observed value is greater than the background (N*M)-vector
tneg.fg threshold when the observed value is smaller than the background (N*M)-vector
num_min_circle.fg minimum number of observations required inside the outer circle N-vector
num_max_circle.fg maximum number of observations used N-vector
aggn_radius.fg radius defining the background aggregation area N-vector
num_max_aggn.fg maximum number of points considered inside the background aggregation area N-vector

Notes:

  • (N*M)-vectors. for each check in the sequence and for each provider, specify one value.
  • doit.fg. one value for each provider. If only one value is specified, it is assumed it is the same for all providers.
  • prio.fg. one value for each provider. If only one value is specified, it is assumed it is the same for all providers.
  • tpos(tneg).fg. one value for each pair provider/test. If only one value is specified, it is assumed it is the same for all providers.
  • other vectors, if just one scalar value is passed, then it is usually recycled for all elements.
  • The observation operator used to extract the background at an observation location is the average of all (up to num_max_aggn.fg) background values within a circle of aggn_radius.fg units (m) from the observation location. If a digital elevation model is associated to the background, then the extracted background value is adjusted considering the elevation difference between the observation location and the average of the digital elevation model adjusted_backg_value = original_backg_value + gamma * ( observation_elevation - aggregated_backg_elevation_from_dem) where gamma is usually set to -0.0065 °C/m. The background uncertainty is set to the standard deviation of the same background values used to compute the average.

R-examples

#!/bin/bash
#==============================================================================
export TITANR_PATH=/home/cristianl/projects/titanlab/R/functions
../titan.r --input.files data/privateObs_20180326T08Z.txt data/kdvh_Norway_wmo_2018032608.txt data/kdvh_Norway_nowmo_nomet_2018032608.txt data/kdvh_Norway_nowmo_met_2018032608.txt data/smhi_Sweden_2018032608.txt --output.file ~/data/out.txt --config.files ini/input.ini ini/test_titan.ini ini/buddy.ini ini/fgt.ini --fg.files ini/fg_det.ini ini/fg_ens.ini
conf <- list(
# M = 5 observation providers
# N = 5 fgt (3 over fg_lab1, 2 over fg_lab2)
# B = 2 background fields: 
#     1 deterministic (fg_lab=1); 1 ensemble (10 members) (fg_lab=2)
#------------------------------------------------------------------------------
             fgt = T,
             fg.code=8,
             i.fg = 10,
             break.fg = 0, 
             transf.fg = F, 
# M vectors
             doit.fg = 1, 
             prio.fg = c(1,1,1,1,1),
# N vectors
             fgt_fglab.fg =c(1,1,1,2,2),
             circle_radius.fg = c( 10000, 20000, 50000, 15000, 25000),
             num_max_aggn.fg = c( 10, 10, 15, 15, 25),
             aggn_radius.fg = c( 10000, 10000, 15000, 15000, 25000),
             num_min_outer.fg = 3,
             num_max_outer.fg = c(20,20,50,30,30),
# M * N
             tpos.fg = c( c(1,1,1,1,1), 
                          c(2,2,2,2,2), 
                          c(2,2,2,2,2),
                          c(1.5,1.5,1.5,1.5,1.5),
                          c(1.2,1.3,1.4,1.5,1.5)),
             tneg.fg = c( c(1.1,1.2,1.3,1.4,1.5), 
                          c(2,2,2,2,2), 
                          c(2.1,2.2,2.3,2.4,2.5),
                          c(1.5,1.5,1.5,1.5,1.5),
                          c(1.2,1.3,1.4,1.5,1.5))
            )