Summary
hand.py computes Height Above Nearest Drainage using D8 flow tracing only. There's no MFD variant.
What's needed
MFD HAND traces downstream from each cell using fraction-weighted paths to find the nearest drainage cell, then returns the elevation difference.
With MFD, each cell has multiple downstream neighbors with nonzero fractions. Options for finding the drainage cell:
- Dominant path -- follow the neighbor with the highest fraction at each step. Gives a single HAND value per cell, most comparable to D8 HAND.
- Weighted minimum -- follow all downstream branches and take the fraction-weighted minimum elevation difference across all paths that reach a stream cell.
Option 1 is simpler and probably sufficient for most uses. The fraction grid handling should follow flow_accumulation_mfd.py.
References
xrspatial/hand.py -- existing D8 implementation
xrspatial/flow_accumulation_mfd.py -- fraction grid construction and handling
Summary
hand.pycomputes Height Above Nearest Drainage using D8 flow tracing only. There's no MFD variant.What's needed
MFD HAND traces downstream from each cell using fraction-weighted paths to find the nearest drainage cell, then returns the elevation difference.
With MFD, each cell has multiple downstream neighbors with nonzero fractions. Options for finding the drainage cell:
Option 1 is simpler and probably sufficient for most uses. The fraction grid handling should follow
flow_accumulation_mfd.py.References
xrspatial/hand.py-- existing D8 implementationxrspatial/flow_accumulation_mfd.py-- fraction grid construction and handling