radarx.grid.multi.network_bias#
- radarx.grid.multi.network_bias(obj, field='DBZH', reference=0, *, valid_range=None, dbz='DBZH', reflectivity_range=None, z_range=None, max_range=None, max_range_ratio=None, min_count=200, bin_width=0.01, max_difference=20.0, select_on='mean', n_threads=None, engine='auto')[source]#
Relative calibration biases of a radar network from its overlap regions.
For every pair of radars
(i, j)the differencesX_i - X_jof a field are collected over all cells of the multi-radar grid observed by both radars at the same height and (after advection) the same time. Seo et al. (2014) [1] compare two ground-based radars by matching their observations in space and time; radarx takes only that idea. Their matching and statistics are not reproduced. The pair biasd_ijis the median difference, resistant to residual clutter, partial beam blockage and attenuation; its spreads_ijis the interquartile range divided by 1.349. The pair biases are then reconciled across the network by weighted least squares,\[\min_b \sum_{(i,j)} \frac{n_{ij}}{s_{ij}^2} \left(b_i - b_j - d_{ij}\right)^2, \qquad b_{ref} = 0,\]so that every radar connected to the reference through a chain of overlaps gets a bias, closed loops of overlaps are made consistent and well-sampled pairs count most. The corrected field is
X - bias.Selection. Cells are chosen by
valid_range(and, for fields other than reflectivity,reflectivity_range). Applying these limits to each radar’s own value censors the two samples separately and biases the median difference: with a true bias of 3 dB and 2 dB of scatter in each radar, the median came out 2.89 dB, and 2.59 dB with weak echo near the lower limit.select_on="mean"(default) applies the limits to the mean of the two radars’ values for the pair instead, a quantity that for equal scatter in the two radars is independent of their difference;"both"restores the earlier censoring of each value. (Selecting on one radar’s own value, for instance the reference radar’s, censors that radar’s sample and so does not remove the bias.) The sample volumes of the two radars should also be similar, whichmax_range_ratioenforces.The median pair bias, the interquartile-range spread (1.349 is the ratio of the interquartile range of a normal distribution to its standard deviation, so IQR / 1.349 estimates sigma), the weights
n / s^2and the least-squares network solution are radarx’s construction, not taken from Seo et al. (2014). The defaults (valid reflectivity 15 to 50 dBZ, companion reflectivity 20 to 40 dBZ,min_count200,bin_width0.01,max_difference20) are radarx choices without a published source.- Parameters:
obj (
xarray.Dataset) – Output ofgrid_radars().field (
str, optional) – Field to compare, e.g."DBZH"or"ZDR". Default"DBZH".reference (
intorstr, optional) – Reference radar (index or name), whose bias is 0. Default: the first.valid_range (
tupleoffloat, optional) – Use only values inside this range on both radars. Default (15, 50) dBZ for reflectivity (above the noise, below hail), no limit for other fields.dbz (
str, optional) – Reflectivity field used byreflectivity_range. Default"DBZH".reflectivity_range (
tupleoffloat, optional) – For fields other than reflectivity: use only cells where both radars measure a reflectivity in this range. Default (20, 40) dBZ, rain without hail, ifdbzis inobj.z_range (
tupleoffloat, optional) – Height range (m above sea level) to use, e.g. below the melting layer. Default: all levels.max_range (
float, optional) – Use only cells within this slant range (m) of both radars.max_range_ratio (
float, optional) – Use only cells whose larger range is at most this times the smaller one (similar sample volumes near the line midway between radars).min_count (
int, optional) – Pairs with fewer matched cells are not used. Default 200.bin_width, max_difference (
float, optional) – Resolution and span of the difference histograms. Differences beyondmax_difference(default 20) are discarded as outliers.select_on (
{"mean", "both"}, optional) – Quantity the value limits act on, see above. Default"mean".n_threads (
int, optional) – Threads for the compiled kernel. Default: all cores.engine (
{"auto", "compiled", "numpy"}, optional) – Implementation to use.
- Returns:
xarray.Dataset–biasandbias_erroronradar(the formal standard error, a lower bound because neighbouring cells are not independent), andpair_bias(median of row minus column radar),pair_spread,pair_countandpair_residualon(radar, other).- Raises:
ValueError – If
fieldis not inobj,referenceis unknown orselect_onis not valid.
Notes
Dask. This function computes the dask array: it compares the overlap of several radars. The input is loaded into memory and the result is held in memory.
References
Examples
>>> bias = radarx.grid.network_bias(grid, "DBZH", reference="KGWX") >>> corrected = grid.DBZH - bias.bias