Skip to content

Buddy event check

Ingrid edited this page May 11, 2022 · 11 revisions

This test is similar to the buddy check, except that observations are converted into yes/no values of exceeding a specified threshold.

In addition to some of the arguments in the buddy check, the test requires an event_threshold, which is the threshold that converts the observations into a yes/no event. The threhsold argument in this test is minimum fraction of other observations in the neighbourhood that must agree with the observation being inspected. If event_threhsold=0.2 and threshold=0.25, then an observation exceeding 0.2 requires that at least 25% of the other observations within the radius also exceed 0.2. If an observation is less than 0.2, then 25% must also be below 0.2.

Input parameters

Parameter Type Unit Description
points Points Point object with station position
values vec ou Observations
radius vec m Search radius
num_min int The minimum number of buddies a station can have
event_threshold float ou the threshold for deciding whether to convert an observation into a yes or no event
threshold float σ the variance threshold for flagging a station
max_elev_diff float m the maximum difference in elevation for a buddy (if negative will not check for heigh difference)
elev_gradient float ou/m linear elevation gradient with height
min_std float If the standard deviation of values in a neighborhood are less than min_std, min_std will be used instead
num_iterations int The number of iterations to perform
obs_to_check ivec Observations that will be checked (since can pass in observations that will not be checked). 1=check the corresponding observation

ou = Unit of the observation, σ = Standard deviations

Returned parameters

Parameter Type Unit Description
flags ivec Quality control flag (0=OK, 1=bad)

Examples

radius = np.full(points.size(), 5000)
num_min = np.full(points.size(), 5)
event_threshold = 0.2
threshold = 0.25
max_elev_diff = 0
elev_gradient = 0
num_iterations = 5
flags = gridpp.buddy_event_check(points, precip_obs, radius, num_min,
            event_threshold, threshold, max_elev_diff, elev_gradient, num_iterations)
# R code
radius <- rep( 500000, length(lats))
num_min <- rep( 5, length(lats))
event_threshold <- 0.2
threshold <- 0.25
max_elev_diff <- 0
elev_gradient <- 0
num_iterations <- 5
flags <- buddy_event_check(points, precip_obs, radius, num_min,
            event_threshold, threshold, max_elev_diff, elev_gradient, num_iterations)