[GRASS-dev] testing results of r.watershed2 against old r.watershed

Hamish hamish_b at yahoo.com
Mon Dec 1 03:52:47 EST 2008


Hi,

r.watershed"2" changes are now merged into r.watershed"1" in SVN devbr6,
trunk. Hopefully without further problems.


Markus Metz wrote:
> Actually I wanted to apply the changes of the r.watershed version in
> grass-7 to r.watershed2, especially naming of options without points
> and uppercase, but didn't get yet to it.

done.  ('svn merge' did 99% of the work after devbr6 was solved)

> Now that some changes have been applied to r.watershed, maybe this is
> sparking some interest in improving some parts here and
> there, as suggested by Helena with regard to lsfac and meter to foot
> conversion,

ok, but I suggest to do it in grass7. bugfixes can be backported as needed.


> also the suggestion of Isaac Ullah to apply a colortable to flow
> accumulation that is equivalent to the visual output and remove the
> "visual" option.

see the man page for an example of making a nicely colored accum map
based on standard deviations.

if visual= is to be removed, that should only happen in grass 7.


> If I suggest changes to the code again, I will supply diffs in the hope
> to support svn change tracking and to avoid the confusion caused by
> adding a module that appears new as far as svn is concerned.

the full module probably meant that it got more testers than a patch
would, which is good, but I guess a SVN copy from trunk to grass-addons
would have retained the merge history better. shrug.

for minor changes a patch vs. trunk is definitely the way to go.


in my tests r.watershed(2) is >80 times faster than r.watershed(1). nice!
(35min -> 25sec for RAM mode to complete; new SEG mode took 4.5min)
all maps appear the same as old r.watershed.

#spearfish
g.region rast=elevation.10m

time r.watershed -m mem=800 elev=elevation.10m threshold=3000 \
  accum=rw2_elev10m.acc \
  drain=rw2_elev10m.drain \
  basin=rw2_elev10m.basin \
  str=rw2_elev10m.stream \
  half.b=rw2_elev10m.halfb \
  vis=rw2_elev10m.viz \
  length.sl=rw2_elev10m.ls \
  slope.st=rw2_elev10m.sls



One thing with -m (seg mode).. without -m (ram mode) it takes 166mb RAM.
With -m it took just under what I set memory= to. If I set mem=950 it
used 911mb RAM. Does it not know it only needs ~166mb instead of full
alloc?

Also, if I set -m memory=1200 the r.watershed.seg exits with an error (11):
[same elevation.10m which takes 166mb in RAM mode]
====
SECTION 1 beginning: Initiating Variables. 6 sections total.
D1/1: segs MB: 1200
D1/1: seg cols: 200
D1/1: seg rows: 200
D1/1:    row segments:  7
D1/1: column segments:  10
D1/1:  total segments:  70
D1/1:   open segments:  419
D1/1:   open segments after adjusting:  419
SECTION 1b (of 6): Determining Offmap Flow.
 100%
 100%
WARNING: category information for [...] missing
[...]
====
G63> echo $?
11

top reported 1150mb allocated, and I have 2gb so plenty still to spare
and not Linux tearing down a runaway proc AFAICT..
so why the early exit?


Hamish



      



More information about the grass-dev mailing list