Verification#
Verification mainly refers to the comparison of radar-based precipitation estimates to ground truth.
Compute quality metrics from a set of observations ( |
|
For a set of projected point coordinates, extract the neighbouring bin values from a data set in polar coordinates. |
- class wradlib.verify.ErrorMetrics(obs, est, *, minval=None)[source]#
Bases:
object
Compute quality metrics from a set of observations (
obs
) and estimates (est
).First create an instance of the class using the set of observations and estimates. Then compute quality metrics using the class methods. A dictionary of all available quality metrics is returned using the
all
method, or printed to the screen using thepprint
method.The
ix
member variable indicates valid pairs ofobs
andest
, based on NaNs andminval
.- Parameters
obs (
numpy.ndarray
) – array of observations (e.g. rain gage observations)est (
numpy.ndarray
) – array of estimates (e.g. radar, adjusted radar, …)minval (
float
) – threshold value in order to compute metrics only for values larger than minval
Examples
>>> obs = np.random.uniform(0, 10, 100) >>> est = np.random.uniform(0, 10, 100) >>> metrics = ErrorMetrics(obs, est) >>> metrics.all() >>> metrics.pprint() >>> metrics.ix
See Routine verification measures for radar-based precipitation estimates and Adjusting radar-base rainfall estimates by rain gauge observations.
- class wradlib.verify.PolarNeighbours(r, az, site, crs, x, y, *, nnear=9)[source]#
Bases:
object
For a set of projected point coordinates, extract the neighbouring bin values from a data set in polar coordinates.
Use as follows:
First, create an instance of PolarNeighbours by passing all the information needed to georeference the polar radar data to the points of interest (see parameters).
Second, use the method extract in order to extract the values from a data array which corresponds to the polar coordinates.
- Parameters
r (
numpy.ndarray
) – (seewradlib.georef
for documentation)az (
numpy.ndarray
) – (seewradlib.georef
for documentation)site (sequence) – sequence of floats (see
wradlib.georef
for documentation)crs (
osgeo.osr.SpatialReference
) – GDAL OSR Spatial Reference Object describing projection (seewradlib.georef
for documentation)x (
numpy.ndarray
) – array of x coordinates of the points in map projection corresponding to crsy (
numpy.ndarray
) – array of y coordinates of the points in map projection corresponding to crsnnear (
int
) – number of neighbouring radar bins you would like to find
Examples
See Routine verification measures for radar-based precipitation estimates.
- extract(vals)[source]#
Extracts the values from an array of shape (azimuth angles, range gages) which correspond to the indices computed during initialisation
- Parameters
vals (
numpy.ndarray
) – array of shape (…, number of azimuth, number of range gates)- Returns
output (
numpy.ndarray
) – array of shape (…, number of points, nnear)