This function identifies river headwater cells based on threshold
values in a topographic index and accumulated area river (generated
using topidx
. Rivers are then traced downslope using a single flow algorithm.
river(DEM,atb,area,res,thatb,tharea)
A matrix of the same size as DEM.
A matrix representing a digital elevation model [m] with equally sized pixels and equal NS and EW resolution
Matrix with topographic index values generated by topidx
Matrix with drainage area values generated by topidx
Resolution of the digital elevation model (m)
A topographic index threshold for headwater cells
A drainage threshold for headwater cells
Wouter Buytaert, Imperial College London, based on an implementation from the Hydrology Group of Lancaster University
Cells that exceed thatb or tharea in the respective maps are identified as headwater cells. The routine then traces down rivers from these cells based on a D8 algorithm and calculates the distance towards the outlet. Outlets are recognized by sinks, map borders or excluded areas (NA). The subcatch
function can be used to set areas outside the target catchment to NA.
See https://github.com/ICHydro/topmodel for examples.
subcatch
, topidx