[GRASS-user] usage of r.mapcalc in python script
Margherita Di Leo
diregola at gmail.com
Tue Dec 21 06:07:41 EST 2010
please any python programmer could explain me the correct use of r.mapcalc
in this case.
In my python script I have a formula like this:
n = 0.016 * (resolution ** 0.46)
(resolution is the cellsize of the input map).
and I have to calculate a map with:
grass.mapcalc("mti = log((exp($rast1 , n)) / $rast2)", rast1 =
'r_accumulation', rast2 = 'r_slope')
but since n is not a map, i get the error:
Invalid map <n>
ERROR: An error occurred while running r.mapcalc
How can I use the 'n' in r.mapcalc?
Thank you in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-user