Thanks Glynn. My solution has been to do as you say with some modifications and the result looks good. I changed the small buffer-circle maps from 1 and nulls to binary rasters so that I can avoid dealing with nulls. I also stopped using the same map as output and input. It was easier to work out the conditional statement without the nulls.
Chris On 26 February 2011 00:59, Glynn Clements <[email protected]> wrote: > > Chris Carleton wrote: > >> ###the problematic r.mapcalc operation is below### >> subprocess.call([ >> "r.mapcalc", >> "B = if(!isnull(A) && temp_rast_focus_ <= B,A,B"]) > > 1. Don't use the same map for both input and output. > > 2. If either temp_rast_focus_ or B are null, the result will be null. > > Except for specific cases, nulls propagate, i.e. if any operand is > null the result will be null. isnull() is an exception, but && isn't > (i.e. "0 && null()" is null, not 0). You might want to use the &&& > operator instead, which satisfies "0 &&& x == 0" and "x &&& 0 == 0" > even when x is null. > > -- > Glynn Clements <[email protected]> > > _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
