Calculates the magnitude of a basin, defined as the number of sources upriver with respect to every point.



Inputs

  1. The !GridCoverage with the drainage directions, obtained with [Markoutlets]


Output

  1. The !GridCoverage containing the matrix of the basin magnitude


Notes

If the river net is a trifurcated tree (a node in which three channels enter and one exits), then between number of springs and channels there exists a bijective correspondence hc = 2ns − 1 where hc is the number of channels and ns the number of sources; the magnitude is then also an indicator of the contributing area.



References