Adapting focal statistics for irregular shapes?

Discussion created by hg223 on May 21, 2012
I don't have experience with python, but I am trying to conceptually solve a problem, such that I can pursue the right tools or processes. Basically, I want to find a way to execute a focal statistics operation where the search window responds to masked barriers. For example, I have a raster layer with cells that are either forest or non-forest. For each cell, I want to identify the proportion of forest within 200 square kilometers. If the raster was entirely area I was interested in, then it would be no problem to simply use one of the built in focal operations - either with a circular or rectangular search window. But, I want to add masked barriers of urban area that are not part of the analysis. For a given point that is, say, next to an urban area, I don't want the program to search in regular shape (circular, rectangle, annulus, wedge) around the point, but instead I want it to identify (and calculate statistics for), the cells that comprise the *NEAREST* 200 square kilometers of viable area. Since the masked urban area isn't viable, I want the function to flow around such barriers, creating an irregular calculation window.

Does anyone know if this is possible without spending an inordinate amount of time on it? Should I be exploring python-based approaches? Any conceptual ideas or direct methods would be great. Thanks for your input!