wradlib.zonalstats.ZonalStatsBase#

class wradlib.zonalstats.ZonalStatsBase(src=None, ix=None, w=None)[source]#

Bases: object

Base class for all 2-dimensional zonal statistics.

The base class for computing 2-dimensional zonal statistics for target polygons from source points or polygons as built up with ZonalDataBase and derived classes. Provides the basic design for all other classes.

If no source points or polygons can be associated to a target polygon (e.g. no intersection), the zonal statistic for that target will be NaN.

Parameters:

src (wradlib.zonalstats.ZonalDataPoly or str) – ZonalDataPoly object or filename pointing to ZonalDataPoly ESRI shapefile containing necessary ZonalData. ZonalData is available as zdata-property inside class instance.

Examples

See ZonalStats.

property zdata#
property ix#
property w#
check_empty()[source]#
mean(vals)[source]#

Evaluate (weighted) zonal mean for values given at the source points.

Parameters:

vals (numpy.ndarray) – 1-d array of type float with the same length as self.src Values at the source element for which to compute zonal statistics

var(vals)[source]#

Evaluate (weighted) zonal variance for values given at the source points.

Parameters:

vals (numpy.ndarray) – 1-d array of type float with the same length as self.src Values at the source element for which to compute zonal statistics

check_empty()

mean(vals)

Evaluate (weighted) zonal mean for values given at the source points.

var(vals)

Evaluate (weighted) zonal variance for values given at the source points.

ix

w

zdata