[GRASS-dev] r.watershed question

Should r.watershed be giving negative accumulation values? I ran it on the spearfish 30m DEM and got results that are increasingly positive downstream for one drainage (as I would expect) and increasingly negative downstream for other drainages (I would not expect this). Do I misunderstand what accumulation is supposed to do?

Here is r.info for the results.

r.info atest_rwaccum
  +----------------------------------------------------------------------------+
  | Layer: atest_rwaccum Date: Sat Dec 20 00:08:40 2008 |
  | Mapset: PERMANENT Login of Creator: cmbarton |
  | Location: Spearfish60_test |
  | DataBase: /Users/Shared/grassdata |
  | Title: Watershed accumulation: overland flow that traverses each cell ( |
  | Timestamp: none |
  |----------------------------------------------------------------------------|
  | |
  | Type of Map: raster Number of Categories: 81709 |
  | Data Type: CELL |
  | Rows: 466 |
  | Columns: 633 |
  | Total Cells: 294978 |
  | Projection: UTM (zone 13) |
  | N: 4928000 S: 4914020 Res: 30 |
  | E: 609000 W: 590010 Res: 30 |
  | Range of data: min = -90540 max = 81709 |
  | |
  | Data Source: |
  | elevation.dem@PERMANENT |
  | |
  | |
  | Data Description: |
  | generated by r.watershed |
  | |
  | Comments: |
  | Processing mode: All in RAM |
  | |
  | r.watershed elevation="elevation.dem@PERMANENT" accumulation="atest_\ |
  | rwaccum" memory=300 |
  | |
  +----------------------------------------------------------------------------+
(Sat Dec 20 00:09:19 2008) Command finished (0 sec)

I am running this on my Mac using GRASS 6.4SVN from 10 December. If there was a major bug fix since that date, I can recompile tomorrow.

Michael

Michael Barton wrote:

Should r.watershed be giving negative accumulation values?

Yes. Negative accumulation values indicate that these cells receive offmap inflow or inflow from a MASKed area from somewhere upstream. This has always been the case for flow accumulation output. Negative flow accumulation can be interpreted as "at least so many cells drain into this cell, but probably more cells that were not included in the region/unMASKed area". State that more clearly in the manpage?

Regards,

Markus M

Thanks for the information. I did look through the docs but didn't see this. I guess I missed it.

So...

r.mapcalc positive_accum=if(accum_map<0,accum_map*-1,accum_map)

...would produce a normal flow accumulation map, but one that underestimates flow in some areas?

Michael
____________________
C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

On Dec 20, 2008, at 1:59 AM, Markus Metz wrote:

Michael Barton wrote:

Should r.watershed be giving negative accumulation values?

Yes. Negative accumulation values indicate that these cells receive offmap inflow or inflow from a MASKed area from somewhere upstream. This has always been the case for flow accumulation output. Negative flow accumulation can be interpreted as "at least so many cells drain into this cell, but probably more cells that were not included in the region/unMASKed area". State that more clearly in the manpage?

Regards,

Markus M

Michael Barton wrote:

Thanks for the information. I did look through the docs but didn't see this. I guess I missed it.

It is mentioned under OPTIONS, accumulation, at least in grass64 r34951 (as of today).

So...

r.mapcalc positive_accum=if(accum_map<0,accum_map*-1,accum_map)

...would produce a normal flow accumulation map, but one that underestimates flow in some areas?

Exactly. If you want accurate flow accumulation for a given area (at least as accurate as the input elevation allows), you have to increase the region until no more surface runoff from outside the region occurs for that area of interest. The basins connected to that area would then not touch the borders of the region.

Markus M

Michael
____________________
C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

On Dec 20, 2008, at 1:59 AM, Markus Metz wrote:

Michael Barton wrote:

Should r.watershed be giving negative accumulation values?

Yes. Negative accumulation values indicate that these cells receive offmap inflow or inflow from a MASKed area from somewhere upstream. This has always been the case for flow accumulation output. Negative flow accumulation can be interpreted as "at least so many cells drain into this cell, but probably more cells that were not included in the region/unMASKed area". State that more clearly in the manpage?

Regards,

Markus M