[GRASS5] testing GRASS5.0.0pre1

Markus Neteler neteler at geog.uni-hannover.de
Fri Apr 20 07:22:28 EDT 2001


Hi Matt
(cc to grass5)

On Thu, Apr 19, 2001 at 03:14:15PM -0400, mberglund wrote:
[...]
> I have set the region to only a small portion (say 2100x2500) where both
> images overlap.
> 
> set r.patch off and running, with my debug, I see it running. And it has
> been doing this for every over half an hour.
> 
> in support.c you will find a while loop, inside a for loop like so:
> while (G_next_cell_stat (&n, &count, statf + i)){
>            printf("%i\n",count); /* just to see if it is running or hung*/
>            if (n && !G_find_cell_stat (n, &count, statf))
>            {
>               if(do_cats)
>               {
>                  G_update_cell_stats (&n, 1, statf);
>                  G_set_cat (n, G_get_cat (n, &pcats), cats);
>               }
>               if(do_colr)
>               {
>                  G_get_color (n, &red, &grn, &blu, &pcolr);
>                  G_set_color (n, red, grn, blu, colr);
>               }
>            }
>         }
>         }
> 
> What is happening in here that would take so long? You did an area about
> half the pixel size mine in 6 seconds. Mine has been running for over an
> hour, although, on a slower machine.
> 
> This is the loop that is holding me up.
> Any thoughts?

Seems we need some test pattern (to get comparable results):
As r.mapcalc is my friend, what about (in a huge location):

 r.mapcalc testA="if(row()%2., row(), null())"
 r.mapcalc testB="if(col()%2., col(), null())"


BTW: the testB takes much more time to calculate. Seems GRASS is row
optimized.

Testing in 4000x4000 location:
nsres:      5
ewres:      5
rows:       4000
cols:       4000
date; r.patch in=testA,testB out=testpatch; date

Fre Apr 20 11:30:48 CEST 2001
r.patch: percent complete: 100%
CREATING SUPPORT FILES FOR testpatch
Fre Apr 20 11:31:40 CEST 2001

(on my 1Ghz Athlon)

d.rast testpatch  -> looks o.k.

Due to above formula I have 4000 categories in each raster map.
­--------------------------------------------------------------------

Now: g.region res=1 -p
nsres:      1
ewres:      1
rows:       20000
cols:       20000
(400MB cells)

Generate first pattern:
date; r.mapcalc testA="if(row()%2., row(), null())"; date
 Fre Apr 20 11:35:01 CEST 2001
 EXECUTING testA = ...  100%
 CREATING SUPPORT FILES FOR testA
 range: 1 19999
          ^^^^^^--> shouldn't this be 20000 ( or: 0..19999)???
 Fre Apr 20 11:42:33 CEST 2001

Generate second pattern:
date; r.mapcalc testB="if(col()%2., col(), null())"; date
 Fre Apr 20 11:42:33 CEST 2001
 EXECUTING testB = ...  100%
 CREATING SUPPORT FILES FOR testB
 range: 1 19999
 Fre Apr 20 12:12:52 CEST 2001

Patch it:
date; r.patch in=testA,testB out=testpatch; date
 Fre Apr 20 12:12:52 CEST 2001
 r.patch: percent complete:  100%
 CREATING SUPPORT FILES FOR testpatch
 Fre Apr 20 12:37:17 CEST 2001

d.rast testpatch

The result seems to be o.k., howeverm there are moire patterns on the
monitor (colored squares) due to the test pattern. If I zoom in the
expected pattern is visible.

Maybe this is a test helping to identify your problem?

Note: The testpatch colr/ table is quite small:
% 1 19999
1:255:255:0 4000.6:0:255:0
4000.6:0:255:0 8000.2:0:255:255
8000.2:0:255:255 11999.8:0:0:255
11999.8:0:0:255 15999.4:255:0:255
15999.4:255:0:255 19999:255:0:0

Perhaps above test should be extended with some r.colors stuff to assign
more colors (to get a larger color table). Note: It is well known that
GRASS becomes *very* slow with more than 8000 entries in color table.

Cheers

 Markus

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list