Message |
Ina,
Spatial Analyst can be persuaded to compute a moving window correlation grid.
To obtain consistent results around the edges, you will need an indicator grid to identify (and later count) the cells where neither of your grids [X] and [Y] is empty. Start by computing the product grid [XY] as [X]*[Y]. One way to produce this indicator (let's call it [I]) is to compute
[XY] - [XY] + 1
This will have 1's in all cells where [XY] is not null and will otherwise be null.
At this point, replace the original grid [X] with [X]*[I] and replace [Y] with [Y]*[I].
Having done these preliminaries, compute the squares of the grids: the square [XX] equals [X]*[X], and the square [YY] equals [Y]*[Y].
The moving-window correlation grid is computed from focal means. Choose a window size and shape. Using this, compute the focal means of [X], [Y], [XX], [YY], and [XY]. Let's call the resulting grids [Xm], [Ym], [XXm], [YYm], and [XYm], respectively. The correlation grid, by definition, is
([XYm] - [Xm]*[Ym]) / Sqrt(([XXm] - [Xm]*[Xm])*([YYm] - [Ym]*[Ym]))
It will have non-null values at all cells having neighborhoods where two more more cells both have non-null values of [X] and [Y] and not all values of [X] and [Y] in those neighborhoods are constant. |