wradlib.adjust.AdjustBase#

class wradlib.adjust.AdjustBase(obs_coords, raw_coords, *, nnear_raws=9, stat='median', mingages=5, minval=0.0, mfb_args=None, ipclass=<class 'wradlib.ipol.Idw'>, **ipargs)[source]#

Bases: IpolBase

The basic adjustment class that inherits to all other classes.

All methods except the __call__ method are inherited to the following adjustment classes.

Parameters
  • obs_coords (numpy.ndarray) – array of floats of shape (number of points, 2) x and y coordinate pairs of observation locations (e.g. rain gauges).

  • raw_coords (numpy.ndarray) – array of floats of shape (number of points, 2) x and y coordinate pairs of raw (unadjusted) radar field

  • nnear_raws (int) – Defaults to 9. This parameter controls the number of radar bins or grid cells (in the neighbourhood of a rain gauge) which is used to compute the value of the radar observation AT a rain gauge.

  • stat (str) – Defaults to ‘median’. Must be either ‘mean’, ‘median’, or ‘best’. This parameter controls the statistic that is used to compute the value of the radar observation AT a rain gauge based on the neighbourhood specified by parameter nnear_raws.

  • mingages (int) – Defaults to 5. Minimum number of valid gages required for an adjustment. If less valid gauges are available, the adjustment procedure will return unadjusted raw values. If you do not want to use this feature, you need to set mingages=0.

  • minval (float) – If the gage or radar observation is below this threshold, the location will not be used for adjustment. For additive adjustment, this value should be set to zero (default value). For multiplicative adjustment, values larger than zero might be chosen in order to minimize artifacts.

  • mfb_args (dict) – Only used for AdjustMFB - This set of parameters controls how the mean field bias is computed. Items of the dictionary are:

    • method: string defaults to ‘linregr’ which fits a regression line through observed and estimated values and then gets the bias from the inverse of the slope. Other values: ‘mean’ or ‘median’ compute the mean or the median of the ratios between gauge and radar observations.

    • minslope, minr, maxp: When using method=’linregr’, these parameters control whether a linear regression turned out to be robust (minimum allowable slope, minimum allowable correlation, maximim allowable p-value). If the regression result is not considered robust, no adjustment will take place.

  • Ipclass (wradlib.ipol.IpolBase) – an interpolation class from wradlib.ipol Not used for AdjustMFB - default value is Idw (Inverse Distance Weighting).

  • ipargs (dict) – keyword arguments to create an instance of ipclass Not used for AdjustMFB - for Idw, these keyword arguments would e.g. be nnear or p.

Examples

See Adjusting radar-base rainfall estimates by rain gauge observations.

xvalidate(obs, raw)[source]#

Leave-One-Out Cross Validation, applicable to all gage adjustment classes.

This method will be inherited to other Adjust classes. It should thus be applicable to all adjustment procedures without any modification. This way, the actual adjustment procedure has only to be defined once in the __call__ method.

The output of this method can be evaluated by using the verify.ErrorMetrics class.

Parameters
Returns

  • obs (numpy.ndarray) – array of floats valid observations at those locations which have a valid radar observation

  • estatobs (numpy.ndarray) – array of floats estimated values at the valid observation locations

__call__(obs, raw, *[, targets, rawatobs, ix])

Returns an array of raw values that are adjusted by obs.

xvalidate(obs, raw)

Leave-One-Out Cross Validation, applicable to all gage adjustment classes.