geoutils.Raster.get_stats#
- Raster.get_stats(stats_name=None, inlier_mask=None, band=1, counts=None)[source]#
Retrieve specified statistics or all available statistics for the raster data. Allows passing custom callables to calculate custom stats.
- Parameters:
stats_name (
Union
[str
,Callable
[[ndarray
[tuple
[int
,...
],dtype
[Union
[floating
[Any
],integer
[Any
]]]]],floating
[Any
]],list
[Union
[str
,Callable
[[ndarray
[tuple
[int
,...
],dtype
[Union
[floating
[Any
],integer
[Any
]]]]],floating
[Any
]]]],None
]) – Name or list of names of the statistics to retrieve. If None, all statistics are returned. Accepted names include: mean, median, max, min, sum, sum of squares, 90th percentile, LE90, nmad, rmse, std, valid count, total count, percentage valid points and if an inlier mask is passed : valid inlier count, total inlier count, percentage inlier point, percentage valid inlier points. Custom callables can also be provided.inlier_mask (
Mask
|ndarray
[tuple
[int
,...
],dtype
[bool
]] |None
) – A boolean mask to filter values for statistical calculations.band (
int
) – The index of the band for which to compute statistics. Default is 1.counts (
tuple
[int
,int
] |None
) – (number of finite data points in the array, number of valid points in inlier_mask). DO NOT USE.
- Return type:
- Returns:
The requested statistic or a dictionary of statistics if multiple or all are requested.