As some of you know, most of my life for the last two years has revolved around predicting the locations of small headwater streams that are not captured by the venerable National Hydrography Dataset. The NHD is a fantastic resource overall, but it does have its shortcomings, particularly in small, ephemeral channels. Usually, the limitations are fairly predictable, as they result from the intersection of limits of scale, subjective cartographic choices, and deliberate design rules that make a map good for one purpose but not necessarily others. Sometimes, those shortomings manifest themselves in unexpected ways.
In flow accumulation modeling, a common bit of data needed is the average upslope value of a parameter of interest, such as slope or curvature. In most cases, this is simply a matter of calculating a flow accumulation weighted by the parameter in question, then dividing this by the unweighted flow accumulation. But what if you want average upslope aspect? Since aspect is measured in degrees, and a value of 0° and 360° are the same, a simple arithmetic mean will be useless. So, what to do? In this post, I will walk you through the process of calculating the mean upslope aspect using ArcGIS, and leave you with a working python script that will automate the process.