No subject
Lars Schylberg
larss at fmi.kth.se
Sat Mar 27 07:39:59 EST 1993
This example was in in one issue of Grass Clippings last year. I
think it came from Dr. Fred Limp (Growing with Grass). This shows how
you could loop over a time t variable and get a spread model for 100
time intervals. Other ways could be to have a loop that finish when a
certain criterion is fullfilled. That could be some criterion that is
analysed with r.stats and awk in the loop. I have some scritps with loops
with r.mapcalc and that finishes when one category is removed completely with
with a filter in r.mapcalc.
Lars
Lars Schylberg Email: larss at fmi.kth.se
Dept. of Geodesy and Photogrammetry
Royal Institute of Technology (KTH) Tel. +46 8 790 86 33
S-100 44 STOCKHOLM, SWEDEN Fax. +46 8 790 66 10
#!/bin/sh
#
# I skipped usuall begining with input check and so on.
#
IN=$1
#
#
# do the spread model
#
echo 't = if( t[-1,-1] > 0, t[-1,-1]-1, \' > spread
echo ' if( t[-2,-1] > 0, t[-2,-1]-3, \' >> spread
echo ' if( t[-1,-2] > 0, t[-1,-2]-3, t ))) ' >> spread
#
# loop to show the spread model
#
g.copy rast=$IN,t
d.rast t
i=1
while [ $i != 100 ]
do
r.mapcalc < spread
d.rast t
i=`expr $i + 1`
done
More information about the grass-user
mailing list