Next: batch, Previous: atomize, Up: Internal Routines [Contents][Index]

`basin(`

`data` [, `sign`, /number, /sink, /difference])

Interprets array

as an altitude map (in arbitrary
dimensions) and determines to which nearest neighbor water at each
location would flow (along the steepest descent if `data`

is
negative or by default; along the steepest ascent if `sign`

is positive or zero). For keywords `sign``/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

of the sink of the basin. If
`data``/difference`

is specified, then the index offset of the visited
neighbor is returned for each pixel.