Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a script that calculates standard deviation for a list of grids using the Cell Statistics function in Spatial Analyst for ArcGIS 10.0 The syntax is this:

stdevGrid = arcpy.sa.CellStatistics(filteredGrids, "STD", "DATA")

However, the output of this command is obvious wrong. Some values are higher than the maximum values for any of the input grids.

In Arctoolbox, I did the same calculation over the same grids and got an output that seemed much more reasonable. However, even using the python window in Arcmap produced the same wacky grid from the original command.

In desperation, I tried to build the command using modelbuilder and check out the resultant code. The output used this command

arcpy.gp.CellStatistics_sa(filteredGrids,<pathForOutputGrid>,"STD","DATA")

I ran this in python and it got the same (correct) result as Arctoolbox, not the incorrect values that the original command did.

The only thing I can figure is that there is an environment setting I'm missing, but as the new line in the exact same place in the original script produced a different output, I'm wondering if this is a bug in ArcGIS 10.0.

Has anyone else run into something like this? Does anyone have any idea why this happens?

share|improve this question
    
Do any of those grids contain NoData values? –  whuber Apr 20 '11 at 21:26
    
Yes they did (1 of them). –  blindJesse Apr 20 '11 at 22:13
    
What happens to the SDs if you replace the NoData cells by zeros? (One possibility is that the cell stats procedure might be reading the NoData codes as actual numbers.) –  whuber Apr 21 '11 at 0:37
    
I didn't do this explicitly but I did check out the output vs the nodata areas in the one grid...and the problem is not just in those areas. –  blindJesse Apr 21 '11 at 3:26
    
If you could provide the different SDs for some grids that might shed some light on the problem. –  whuber Apr 21 '11 at 3:33
show 6 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.