r.mapcalc loops

/S=E.ODOHERTY/OU1=R02F06A at mhs-fswa.attmail.com /S=E.ODOHERTY/OU1=R02F06A at mhs-fswa.attmail.com
Thu Jun 26 15:10:24 EDT 1997


Is it possible to do a loop within r.mapcalc?  If so, could someone 
post an example of how I could increment the i and j variables that 
indicate the relative position of a pixel (eg., x[-1,2].  I  
determined that I could put an address in those positions and do the 
loop around r.mapcalc, but I assume I could save time if I can do it 
within.  I want to do a pretty big neighborhood but keep the window
resolution high.  If I were a REAL woman of course I would do it all 
in C, but it boggles my mind.  Any suggestions?  I'm trying to 
put an error distribution around telemetry points.
My guts of my current script is like this:
r.mapcalc count_sites = 0
i=-5
j=-5
(looping stuff here, including weights for each i,j)
  r.mapcalc count_sites = count_sites + telempts[Si,Sj]
(increment Si and Sj here and loop again until max i and j are 
reached in this example it would be 5)
Erin O'Doherty   eodohert at wyoming.com
Rocky Mountain Research Station
USDA Forest Service



More information about the grass-user mailing list