The Raster Object has several summary statistics available including maximum, minimum and mean. There is no statistic for the sum of the value for the Raster variables. Please consider adding sum as a Raster object method and as a value in the new as of 3.1 computeStatistics method.
This Idea has been implemented in ArcGIS Pro 3.2, usage:
in_raster = r"C:\path\to\data.tif"
rast = arcpy.Raster(in_raster)
stat = rast.computeStatistics()
print(stat)
print(rast.sum)
Please see the What's New documentation for more new features in Pro 3.2. Additionally, we have posted a Your Ideas in ArcGIS Pro 3.2 blog and video, take a look if interested!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.