I used the tool Calculate Statistics on a few raster files. With most of them I got useful values for Min, Max, Mean and Std dev. But for 4 of them the Mean and Std dev. row only show the value "nan" while Min and Max are displayed properly. Do you have any advice how to fix the issue or an idea for another way to get the mean of a raster file?
Thank you very much!
Lisa
nan typically means 'not as number'. Are the min and the max values real numbers?
Hello Joe,
thank you for your answer! After I closed and reopened the ArcMap document, the tool worked fine and I got all the results I wished for. Never stop believing in wonders
Voodoo science. Haven't had one since yesterday where I found a text field set to 255 characters that had 269 characters in it.....
Joe is right about nan,
Calculate Statistics—Data Management toolbox | ArcGIS Desktop
You need to specify your nodata values in each raster, so check their properties.
If you are still having problems convert your raster to a numpy array using arcpy's
RasterToNumPyArray
Then you can do thing like
np.nanmean(arr), np.nanstd(arr), np.nanmin(arr)
etcetera
I have a number of blogs on working with rasters and statistics
/blogs/dan_patterson/2018/02/06/cell-statistics-made-easy-raster-data-over-time