Calculate the mean of multiple rasters and save the result into a new raster.

4747
3
01-26-2019 02:30 AM
NikosTziokas
New Contributor II

Hi,

I have a set to 502 rasters (time series) of MO11A2 products (MODIS LST 8-day product), MOD11A2.A2008001.tif, MOD11A2.A2008009.tif etc. They have the same extent and CRS. I want these 8-day products to be averaged into monthly composites. Could "Cell Statistics" do this job?

I am using ArcMap 10.3.

I have found a similar question, but I want to be sure that the function is the right one.

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

If you are doing them in batches of a month (30), then cell statistics will give you the average of the month.

Things get more complicated if you want to do rolling/moving statistics (ie incrementing by 1 day with a 30 day increment).

There are methods outside of cell statistics that cover some of these scenarios.  I have a number of blog posts on related issues.

/blogs/dan_patterson/2018/02/06/cell-statistics-made-easy-raster-data-over-time 

but to keep your scenarios simple, block your 500ish rasters into 30 day chunks and use cell statistics on each chunk... assuming that you are using ArcGIS pro and have lots of memory. You wont be able to simply load all 500 rasters and do a 30day block mean because of memory issues.

Alternatives would include using smaller chunks (say 5 days * 6 chunks) and doing a sum on each... then divide the resultant by the number of chunks to get your 30 day average.

There are other possibilities, but those can be discussed should all the above fail.

PS.  rasters need to have the exact same extent, cell size, snap raster and you will need to account for nodata values during the calculations (numpy handles these readily btw)

NikosTziokas
New Contributor II

Thank you for your fast reply.

I have already separated the rasters in different chunks (each chunk represents a single month).

0 Kudos
DanPatterson_Retired
MVP Emeritus

Then give it a try, the cell statistics with mean/average is what you would want.  Check the nodata setting carefully to get the desired result.

If there are too many rasters you may run into memory errors and will have to go with sub-chunks using the 'sum' option, then average those (ie 3 chunks of 10 with sum, to get 3 results which you average)