Select to view content in your preferred language

-1.#IND Returned by Cell Statistics: STD

545
3
08-21-2012 05:21 PM
MathewSchmidtlein
Deactivated User
I calculated the local standard deviation of 1,000 input rasters using the cell statistics tool, and many of the cells returned values of -1.#IND.  I haven't been able to find anywhere what it means, or how to address it.  When I export it as an ASCII grid to use in another program (R), this value imports as a -1, which is problematic.

It looks like these values may be returned for cells where the input values are identical across the local cell values. (I haven't checked everyone of them, though).

Does anyone know what this is?  I've tried searching the ESRI support, as well as Python, and haven't been able to find anything yet.
0 Kudos
3 Replies
curtvprice
MVP Esteemed Contributor
Sure looks like a bug to me, but in the meantime, you could always use python to do a text replace on the asciigrid file to replace "-1" with "0" before you read it into R (or do the replace in R). (This should be easy to do as standard deviation will always be non-negative values.)
0 Kudos
MathewSchmidtlein
Deactivated User
Thanks, Curtis.  That is what I have done.  I'm just leary of outputs I can't explain.  I always feel like if I can't explain what happens in one place, I can't be sure I know what is going on elsewhere.
0 Kudos
Luke_Pinner
MVP Regular Contributor
The STD calculation tried to do an 'illegal' operation and an indeterminate (#IND) value (also known as NaN or "Not a Number") was returned. You'll get this trying to calculate the square root of a negative number - i.e sqrt(-1.0). As standard deviation = square root(variance), perhaps a cells variance is set to -1 or -9999 or someother negative number when there's a nodata value...?

More info:
http://www.johndcook.com/IEEE_exceptions_in_cpp.html
0 Kudos