[GRASS-user] using mapcalc in a python script

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Wed Jun 30 21:36:26 EDT 2010


Ned Horning wrote:
> I am working on converting a shell script to python and ran into a
> problem I haven't been able to figure out using the r.mapcalc command.
> Can someone let me know how to write the following command using python.
> The command creates a GRASS MASK layer:
> 
> r.mapcalc "MASK=if(($cloudResampName < 0.01000),1,null())"
> 
> I'm trying to run the python script using GRASS 6.40RC6 (2010).


Ned,

the best place to look for (that I can think of right now) is the scripts 
directory of grass_trunk (grass7). There are several (if not all?) python 
scripts. For example running "grep mapcalc */** | grep .py" within 
grass_trunk/scripts gives several hits.

Good luck, Nikos


More information about the grass-user mailing list