Skip to content

Buddy check

Cristian Lussana edited this page Feb 25, 2021 · 32 revisions

Compares an observation against its neighbours (i.e. buddies) in a predefined square-box.

The neighbourhood box is specified by radius [m], which is the half-width of the box in meters. A minimum number of observations (buddies_min) is required to be available in the square-box and the range of elevations in the square-box must not exceed diff_elev_max metres . The number of iterations is set by num_iterations. The buddy check compares the value of the centroid observation against the averaged value in the square-box. In the case of temperature, elevation differences should be taken into account because all observations are reported to the elevation of the centroid observation before averaging. A linear vertical rate of change of temperature can be set by elev_gradient. A recommended value is elev_gradient=-0.0065 °C/m (as defined in the ICAO international standard atmosphere). if diff_elev_max is negative then don't check elevation difference and do not correct the observed values.

The observation is flagged as suspect if the (absolute value of the) difference between obs and avg normalized by the standard deviation in the square-box is greater than a predefined threshold.

Example

radius = np.full(len(lats), 5000)
num_min = np.full(len(lats), 5)
threshold = 2
max_elev_diff = 200
elev_gradient = -0.0065
min_std = 1
num_iterations = 5
flags = gridpp.buddy_check(lats, lons, elevs, temp_obs, radius, num_min,
            threshold, max_elev_diff, elev_gradient, min_std, num_iterations)