This tool can be used to calculate the difference between the elevation of each grid cell and the mean elevation of the centering local neighbourhood, normalized by standard deviation. Therefore, this index of topographic residual is essentially equivalent to a local z-score. This attribute measures the relative topographic position as a fraction of local relief, and so is normalized to the local surface roughness. DevFromMeanElev
utilizes an integral image approach (Crow, 1984) to ensure highly efficient filtering that is invariant with filter size.
The user must input a digital elevation model (DEM) (dem
) and the size of the neighbourhood in the x and y directions (filterx
and filtery
), measured in grid size.
While DeviationFromMeanElev
calculates the deviation from mean elevation (DEV) at a single, user-defined scale, the max_elevation_deviation tool can be used to output the per-pixel maximum DEV value across a range of input scales.
DiffFromMeanElev
, max_elevation_deviation
def deviation_from_mean_elevation(self, dem: Raster, filter_size_x: int = 11, filter_size_y: int = 11) -> Raster: ...