surface op• Data kinds: depth → image2d
• Call: import fullseye as fs; fs.ledger.dem_aspect(dem, cell_size, method='horn', flat_tol=1e-12) (to call the implementation directly, import demops; demops.dem_aspect(dem, cell_size, method='horn', flat_tol=1e-12); from the registry, opsdem.get("dem_aspect"))
Slope aspect [degrees]. North is 0 degrees, increasing towards east. Flat cells get ASPECT_FLAT.
Flat cells are not returned as 0 because 0 would mean "north-facing slope" —— returning an indistinguishable value is the textbook case of being wrong without raising.
Procedure: take the same 3x3 gradient (dz/dx, dz/dy) as dem_slope, convert the direction of the downhill gradient atan2(-dz/dx, -dz/dy) to degrees and wrap it into [0, 360). Assuming row 0 is north and the direction of increasing column is east: north 0 / east 90 / south 180 / west 270. Passing a grid whose row 0 is south (a vertically flipped array) swaps north and south, and no exception is raised.
• dem, cell_size, method: same contract as dem_slope (3x3 or larger, nan for missing data, sentinel values rejected, cell_size positive [m]).
• flat_tol: if the gradient magnitude hypot(dz/dx, dz/dy) [m/m] is at or below this, the cell is treated as flat and ASPECT_FLAT (= -1.0) is returned. The default 1e-12 covers only "numerically exactly flat". Even flat land with integer elevations can get an aspect from tiny gradients, so stating a meaningful threshold (e.g. 1e-3) explicitly is advisable.
• Return value: (H, W) float64. [0, 360) or -1.0. Around nan cells, nan.
• When taking a histogram or mean of aspects, remove -1 first (out >= 0).
• dem_terrain_analysis family guide
• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).
• Operator provenance and references — the sources of the research/methods this op family came from.
• The canonical algorithm (author, year) and its uses are named in the family usage guide above.
• poc_dem_terrain — py -3.11 examples/poc_dem_terrain.py
• poc_geodetic_height_frames — py -3.11 examples/poc_geodetic_height_frames.py
image2d as input)—
surface)dem_slope · dem_curvature · dem_roughness · dem_tpi
*Provenance: demops.py — DEM operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.