tiggs03

Averaging raster grids with missing values

Discussion created by tiggs03 on Apr 9, 2012
Latest reply on Apr 9, 2012 by curtvprice
I have 10 raster grids and need to generate a summary raster that is the mean of all 10. Unfortunately, there are some missing values (which I guess No Data are actually coded as -9999) in a couple of the rasters, and when I simply use the raster calculator, it only evaluates where data is available in all grids. So there are gaps in the summary "mean" raster. I'd rather that the mean is generated by ignoring where there are NaNs. For instance, if there is a gap in Grid 1, the mean for that gap area is just calculated from Grids 2-10. Any ideas on how to do this?  Maybe some Python code?

OR is there a way to interpolate the rasters with holes? I've only interpolated on point values before so I'm not sure if this is possible.

Thanks!

Outcomes