The objective of this module is the adjustment of radar-based rainfall estimates by rain gage observations. However, this module could also be applied to adjust satellite rainfall by rain gage observations, remotely sensed soil moisture patterns by ground truthing moisture sensors, or any dense spatial point pattern which could be adjusted by sparse point measurements (ground truth).
Basically, we only need two data sources:
point observations (e.g. rain gage observations)
set of (potentially irregular) unadjusted point values (e.g. remotely sensed rainfall)
[Goudenhoofdt et al., 2009] provide an excellent overview of adjustment procedures. The general idea is that we quantify the error of the remotely sensed rainfall at the rain gage locations, assuming the rain gage observation to be accurate.
The error can be assumed to be purely additive
AdjustAdd), purely multiplicative
or a mixture of both (
If the error is assumed to be heterogeneous in space
AdjustMixed), the error at the rain gage locations is
interpolated to the radar bin locations and then used to adjust (correct)
the raw radar rainfall estimates. In case of the AdjustMFB approach, though,
the multiplicative error is assumed to be homogeneous in space.
The basic procedure consists of creating an adjustment object from the class
you want to use for adjustment. After that, you can call the object with the
actual data that is to be adjusted. The following example is using the
additive error model with default settings.
raw_coords represent arrays with coordinate pairs for the gage
observations and the radar bins, respectively.
arrays containing the actual data:
adjuster = AdjustAdd(obs_coords, raw_coords) adjusted = adjuster(obs, raw)
raw need to be flat (1-dimensional) arrays of shape (n,)
that have the same length as the the
The user can specify the approach that should be used to interpolate the error
in space, as well as the keyword arguments which control the behaviour of the
interpolation approach. For this purpose, all interpolation classes from the
wradlib.ipol module are available and can be passed by using the
ipclass argument. The default interpolation class is
Inverse Distance Weighting (
Idw). If you want to use
e.g. linear barycentric interpolation:
import wradlib.ipol as ipol adjuster = AdjustAdd(obs_coords, raw_coords, ipclass=ipol.Linear) adjusted = adjuster(obs, raw)
Be aware that there are a lot of control parameters that can dramatically influence the behaviour of the adjustment (which gauges are considered, how is an error interpolation carried out, …). Read the docs carefully and try to experiment with the effects of the different control parameters. There might be situations in which the algorithms decides - based on the control parameter - not to do an adjustment and just return the unadjusted values.
Another helpful feature is an easy-to-use method for leave-one-out
cross-validation [B4]. Cross validation is a standard
procedure for verifying rain gage adjustment or interpolation procedures. You
can start the cross validation in the same way as you start the actual
adjustment, however, you call the
method instead. The result of the cross validation are pairs of observation
and the corresponding adjustment result at the observation location. Using the
wradlib.verify module, you can compute error metrics for the cross
adjuster = AdjustAdd(obs_coords, raw_coords) observed, estimated = adjuster.xvalidate(obs, raw) from wradlib.verify import ErrorMetrics metrics = ErrorMetrics(observed, estimated) metrics.report()
The basic adjustment class that inherits to all other classes.
Multiplicative gage adjustment using one correction factor for the entire domain.
Gage adjustment using a multiplicative error model
Gage adjustment using an additive error model.
Gage adjustment using a mixed error model (additive and multiplicative).
Get the raw values in the neighbourhood of the observation points
Same behaviour as the other adjustment classes, but returns an interpolation of rain gage observations
Same behaviour as the other adjustment classes, but simply returns the unadjusted data.