Using iterator to convert "time of last fire" rasters to "number of fires" raster

Discussion created by sbaumgarten on Feb 25, 2012

I have a series of rasters showing "time of last fire" over a 50 year time period (one raster per year, values ranging from 0-50). I need to combine these into a single raster showing the total number of fires in each pixel over the 50 year period. I will then need to iterate this entire process roughly 100 times.

I have been trying to use the raster iterator, combined with raster calculator, but am not sure what expression to use in raster calculator. In the expression I need to be able to refer to both the raster for time (t) and the raster for time (t-1). For example:

Con("%timeoflastfire_%i%%" != "%timeoflastfire_%i-1%%" , "%timeoflastfire_%i%%"+1 , "%timeoflastfire_%i%%")

I don't think "%timeoflastfire_%i-1%%" is correct syntax, but is there a way to accomplish this? Also, is there a way to specific a different outcome for the raster for time t=0?