BASIN(data [, sign, /NUMBER, /SINK, /DIFFERENCE])
Interprets array data as an altitude map (in arbitrary
dimensions) and determines to which nearest neighbor water at each
location would flow (along the steepest descent if sign is
negative or by default; along the steepest ascent if sign
is positive or zero). For keywords /NUMBER and /SINK all
elements in each basin defined by a common sink (or peak) are labeled
with the same number, which is different from the labels for all other
basins. For /NUMBER (and by default), the labels are consecutive
ordinal numbers starting at 1. For /SINK, the labels are equal
to the index to data of the sink of the basin. If
/DIFFERENCE is specified, then the index offset of the visited
neighbor is returned for each pixel.
See also: SEGMENT, AREA, AREA2, Topology
[2.12.413]