I'm having some issues with the Cell Statistics tool in a python script I am writing. I am using 30 years worth of global cumulative annual rainfall data as input and am getting strange values in some areas of my output raster.
In the image below the very bright areas have standard deviation values of around 2000. This is much higher than it should be. Besides these very bright areas the rest of the values in the raster look correct (tested by manually calculating standard deviation values). This is the standard deviation as calculated by my script.
Using the same set of input I calculated the standard deviation in ArcMap 10.2.2 using the cell statistics geoprocessing tool and got different results. The standard deviation seems to be correctly calculated across the entire extent of the raster.
I am providing statistics on the two raster in case it is helpful to anyone.
min = 0 max = 6697.9404296875 mean = 75.83343676729601 std. dev. = 333.72000491046
min = 0 max = 1507.4833984375 mean = 35.804817248754 std. dev. = 84.35107381816201
There are no no data values under the issue areas that would be causing this. Why are only some of the values being calculated correctly when I process using arcpy? Any ideas about what is going on?
Edit: Added method from script where standard deviation is being calculated.
def calc_cv_raster(self, data_lst): print "\nCalculating coefficient of variation raster." std_dev = sa.CellStatistics(data_lst, 'STD', 'DATA') avg = sa.CellStatistics(data_lst, 'MEAN', 'DATA') cv = (std_dev / avg) * 100 print "Calculated coefficient of variation raster." return cv