<div dir="ltr">Hello all, this is my first time using a subscriber list and I have some doubts about using it and about grass gis.<div><br></div><div>I have an AML script (old arcinfo srcipt) that uses focal operations that I've sorted out well using r.neighbors but I have a problem in certain part of the script to follow in grass GIS. In some part of the script the author declares a variable as a grid called "cbd" and codes as follows:</div>

<div><br></div><div><p style="margin-bottom:0cm"><font style="font-size:11pt" face="courier new, monospace"><b>%cb%d
= int(abs((%cb% - %cb%(1,0)) + (%cb% - %cb%(0,1)) + (%cb% -
%cb%(0,-1)) + (%cb% - %cb%(-1,0))))</b></font></p><div><br></div><div style>From where he obtains a grid filled with integer positive values from 0 to 4. All these values come from a binary grid (0 or 1 values) declared as "cb" where I believe<b><font face="courier new, monospace"> (%cb% - %cb%(1,0)) </font></b>means something like "central pixel value minus pixel value at west from central pixel value" and <b><font face="courier new, monospace">(%cb% - %cb%(0,1)) </font></b>means something like "central pixel value minus pixel value at north from central pixel value", and so on...</div>

<div style><br></div><div style>How could I obtain the differences between central pixel values and cardinal directions pixel values related with a central pixel?</div><div><br></div><div style>Or in a different manner, how to do this in grass gis?</div>

<div style><br></div><div style>RASTER_OUT= round(abs((RASTER_IN - RASTER_IN_PUSHED_ONE_ROW_UP) + (RASTER_IN - RASTER_IN_PUSHED_ONE_ROW_DOWN) + (RASTER_IN - RASTER_IN_PUSHED_ONE_COLUMN_LEFT) + (RASTER_IN - RASTER_IN_PUSHED_ONE_COLUMN_RIGHT))</div>

<div><br></div><div style><br></div><div style>Thanks in advance.</div><div style><br></div>-- <br>Saludos,<div><br></div><div>Yasser</div>
</div></div>