D8 Algorithm for Hydrological Models

Finds most likely locations for water channels given a potential

您现在正在关注此提交

Step 1: Find flow direction (find min. potential of all adjacent cells)
Step 2: Follow flow direction to sum the cumulative # cells flowing into
a given "minimum" cell.
Step 3: Find the maximum likely channel location in each E-W direction
for a given number of channels.

NOTE: The user should make sure that the upstream portion of the
potential matrix Psi corresponds to first row of the matrix.

USAGES
[channel,I] = d8alg(Psi)
[channel,I] = d8alg(Psi,numChans)
[channel,I] = d8alg(Psi,Accum, numChans)
[channel,I] = d8alg(Psi,Accum,numChans,'plot')

INPUT:
Psi: An MxN array giving the hydraulic potential over a grid.
Accum: The accumulation matrix. This weights each cell with a fluid
volume. Must be same size as Psi.
numChans: The number of channels to be chosen per column.
plotopt: Gives an option to plot images of the potential and the channel
locations, is a string 'plot'

OUTPUT:
channel: The channel locations are specified by a matrix in which all the
elements without channels are 0 and all the elements with a
channel are equal to the accumulation.
I: the index matrix giving the channel locations.

-------------------------------------------------------------------------
EXAMPLE: See example on d-8 tutorial, provided by the following tutorial:
http://www.niu.edu/landform/nonlinearRules.htm

%make potential function
Psi =[14,13,13,14,11;
11,12,14,13,10;
11,10,11,11, 9;
8, 9, 11,10, 8;
6, 8, 10, 7, 9];

Acc = ones(size(Psi));

%make accumulation function. Compare to website accumulation function.
%Note the last row of the website prediction contains an error. One arrow
%in the predicted flow direction is pointed the wrong way.

[channel,I] = d8alg(Psi,Acc,2,'plot');

%The predicted channel locations match with what you would expect from
%the accumulation plot?

引用格式

Joshua Carmichael (2026). D8 Algorithm for Hydrological Models (https://ww2.mathworks.cn/matlabcentral/fileexchange/21682-d8-algorithm-for-hydrological-models), MATLAB Central File Exchange. 检索时间: .

类别

Help CenterMATLAB Answers 中查找有关 Oceanography and Hydrology 的更多信息

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
1.2.0.0

plotting bug now fixed.

1.1.0.0

Many bugs in code. Corrected with test example. More robust and with additional options as well.

1.0.0.0