mtgis

Cell Statistics Bug

Discussion created by mtgis on Apr 20, 2011
Latest reply on Apr 21, 2011 by mtgis
Hi All - I was wondering if somebody would be willing to provide some information on a problem I've been having lately with using Cell Statistics in Python?  Specifically,  I wanted to use Cell Stats to give me the Max cell value for each pixel in a list of 20 rasters.  Below is the code:

env.workspace = workspace
for rasters in arcpy.ListRasters():
    evi = arcpy.Raster(rasters)
CellStats = CellStatistics([evi], "MAXIMUM", "DATA")
CellStats.save(output + "MeanMax")


The result is a raster that has the SUM of all the pixels not the MAX.  When using the tool directly in ArcGIS Desktop 10 and I add all 20 of my rasters the output is correct.  Any thoughts on why the tool in python is adding all the cells together instead of providing me the max value?  Thanks much.

Outcomes