This tool can be used to assign the Hack stream order to each link in a stream network. According to this common stream numbering system, the main stream is assigned an order of one. All tributaries to the main stream (i.e. the trunk) are assigned an order of two; tributaries to second-order links are assigned an order of three, and so on. The trunk or main stream of the stream network can be defined either based on the furthest upstream distance or by selecting the larger drainage area, a surrogate measure of discharge, at each bifurcation (i.e. network junction). If drainage area is used, the name of a drainage area raster must be specified.
Stream order is often used in hydro-geomorphic and ecological studies to quantify the relative size and importance of a stream segment to the overall river system. Unlike some other stream ordering systems, e.g. Horton-Strahler stream order and Shreve's stream magnitude, Hack's stream ordering method increases from the catchment outlet towards the channel heads. This has the main advantage that the catchment outlet is likely to be accurately located while the channel network extent may be less accurately mapped.
The user must specify the names of a streams raster image and D8 pointer image. Stream cells are designated in the streams image as all positive, nonzero values. Thus all non-stream or background grid cells are commonly assigned either zeros or NoData values. The pointer image is used to traverse the stream network and should only be created using the D8 algorithm. Background cells will be assigned the NoData value in the output image. The output raster is of an integer data type and continuous data scale.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
streamsFile = wd + "streams.dep"
pointerFile = wd + "D8 pointer.dep"
outputFile = wd + "output.dep"
useDrainageArea = "false"
args = [streamsFile, pointerFile, outputFile, useDrainageArea]
pluginHost.runPlugin("HackStreamOrder", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def streamsFile = wd + "streams.dep"
def pointerFile = wd + "D8 pointer.dep"
def outputFile = wd + "output.dep"
def useDrainageArea = "true"
def drainageAreaFile = wd + "drainage area.dep"
String[] args = [streamsFile, pointerFile, outputFile, useDrainageArea, drainageAreaFile]
pluginHost.runPlugin("HackStreamOrder", args, false)