Skip to content

Commit

Permalink
Rename to r.flowaccumulation
Browse files Browse the repository at this point in the history
  • Loading branch information
HuidaeCho committed Oct 15, 2023
1 parent 7b8fa9a commit 9f9e2c1
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 21 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<h2>DESCRIPTION</h2>

<em>r.accum</em> calculates flow accumulation from a flow direction raster map
using the Memory-Efficient Flow Accumulation (MEFA) parallel algorithm by Cho
(2023).
<em>r.flowaccumulation</em> calculates flow accumulation from a flow direction
raster map using the Memory-Efficient Flow Accumulation (MEFA) parallel
algorithm by Cho (2023).

<h2>NOTES</h2>

Unlike <em>r.watershed</em>, but just like <em>r.accumulate</em>,
<em>r.accum</em> does not require elevation data to calculate flow
<em>r.flowaccumulation</em> does not require elevation data to calculate flow
accumulation. Instead, this module only uses a flow direction raster map to
trace and accumulate the amount of flow draining through and including each
cell.

<em>r.accum</em> supports parallel computation of flow accumulation using
OpenMP while <em>r.accumulate</em> does not.
<em>r.flowaccumulation</em> supports parallel computation of flow accumulation
using OpenMP while <em>r.accumulate</em> does not.

<p>The module recognizes three different formats of flow directions:
<div align="center">
<img src="r_accum_formats.png" alt="degree">
<img src="r_flowaccumulation_formats.png" alt="degree">
</div>

<p>Since the module does not use elevation data (i.e., slope), flow
Expand All @@ -29,7 +29,7 @@ <h2>EXAMPLES</h2>
These examples use the North Carolina sample dataset.

<p>Calculate flow accumulation using <em>r.watershed</em> and
<em>r.accum</em>:
<em>r.flowaccumulation</em>:
<div class="code"><pre>
# set computational region
g.region -p raster=elevation
Expand All @@ -38,32 +38,33 @@ <h2>EXAMPLES</h2>
# for comparison, use -s (SFD)
r.watershed -sa elevation=elevation accumulation=flow_accum drainage=drain_directions

# calculate flow accumulation using r.accum
r.accum input=drain_directions output=flow_accum_new
# calculate flow accumulation using r.flowaccumulation
r.flowaccumulation input=drain_directions output=flow_accum_new

# copy color table
r.colors map=flow_accum_new raster=flow_accum

# check difference between flow_accum and flow_accum_new
r.mapcalc expression="accum_diff=if(flow_accum-flow_accum_new, flow_accum-flow_accum_new, null())"
r.mapcalc expression="flowaccumulation_diff=if(flow_accum-flow_accum_new, flow_accum-flow_accum_new, null())"
</pre></div>

<img src="r_accum_nc_example.png">
<img src="r_flowaccumulation_nc_example.png">

<p>For some reason, there are slight differences between the two output maps.
The yellow and purple cells show the difference raster map (<i>accum_diff</i>).
The red arrows and numbers represent drainage directions
(<i>drain_directions</i>) and flow accumulation by <em>r.watershed</em>
(<i>flow_accum</i>), respectively. Note that some cells close to headwater
cells are assigned 1 even though they are located downstream of other cells.
The yellow and purple cells show the difference raster map
(<i>flowaccumulation_diff</i>). The red arrows and numbers represent drainage
directions (<i>drain_directions</i>) and flow accumulation by
<em>r.watershed</em> (<i>flow_accum</i>), respectively. Note that some cells
close to headwater cells are assigned 1 even though they are located downstream
of other cells.

<p><img src="r_accum_r_watershed_nc_example.png">
<p><img src="r_flowaccumulation_r_watershed_nc_example.png">

<p>For comparison, these numbers show the new flow accumulation by
<em>r.accum</em> (<i>flow_accum_new</i>). The same cells are properly
accumulated from the headwater cells.
<em>r.flowaccumulation</em> (<i>flow_accum_new</i>). The same cells are
properly accumulated from the headwater cells.

<p><img src="r_accum_nc_comparison.png">
<p><img src="r_flowaccumulation_nc_comparison.png">

<h2>SEE ALSO</h2>

Expand Down
File renamed without changes
File renamed without changes.

0 comments on commit 9f9e2c1

Please sign in to comment.