There are various ways to correct specific errors and artifacts in
radar-based quantitative precipitation estimates (radar QPE).
Alternatively, you might want to correct your radar QPE regardless of
the error source - by using ground truth, or, more specifically, rain
gauge observations. Basically, you define the error of your radar QPE at
a rain gauge location by the discrepancy between rain gauge observation
(considered as “the truth”) and radar QPE at that very location. Whether
you consider this “discrepancy” as an additive or multiplicative
error is somehow arbitrary - typically, it’s a mix of both. If you
quantify this error at various locations (i.e. rain gauges), you can go
ahead and construct correction fields for your radar QPE. You might
compute a single correction factor for your entire radar domain (which
would e.g. make sense in case of hardware miscalibration), or you might
want to compute a spatially variable correction field. This typically
implies to interpolate the error in space.

# number of neighbours to be usednnear_raws=3# adjust the radar observation by additive modeladd_adjuster=adjust.AdjustAdd(obs_coords,radar_coords,nnear_raws=nnear_raws)add_adjusted=add_adjuster(obs,radar)# adjust the radar observation by multiplicative modelmult_adjuster=adjust.AdjustMultiply(obs_coords,radar_coords,nnear_raws=nnear_raws)mult_adjusted=mult_adjuster(obs,radar)# adjust the radar observation by AdjustMixedmixed_adjuster=adjust.AdjustMixed(obs_coords,radar_coords,nnear_raws=nnear_raws)mixed_adjusted=mixed_adjuster(obs,radar)# adjust the radar observation by MFBmfb_adjuster=adjust.AdjustMFB(obs_coords,radar_coords,nnear_raws=nnear_raws,mfb_args=dict(method="median"))mfb_adjusted=mfb_adjuster(obs,radar)

We use the verify module to compare the errors of different
adjustment approaches.

Here, we compare the adjustment to the “truth”. In practice, we would
carry out a cross validation.

In [5]:

# Verification for this examplerawerror=verify.ErrorMetrics(truth,radar)mfberror=verify.ErrorMetrics(truth,mfb_adjusted)adderror=verify.ErrorMetrics(truth,add_adjusted)multerror=verify.ErrorMetrics(truth,mult_adjusted)mixerror=verify.ErrorMetrics(truth,mixed_adjusted)

/opt/conda/envs/wradlib/lib/python3.7/site-packages/wradlib/adjust.py:628: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.
slope, _, _, _ = np.linalg.lstsq(x, y)