Hi all,<div><br></div><div>I need a little help with r.mapcalc syntax in Python script. I want to convert the following formula:</div><div><br></div><div>grass.run_command(&#39;r.mapcalculator&#39;, amap = r_stream+&#39;_nothin&#39; , formula = &#39;%s*%s&#39; % (r_stream+&#39;_nothin&#39;, r_mask) , outfile = r_stream+&#39;_nothin&#39;, overwrite = True)</div>
<div><br></div><div>I want to use r.mapcalc instead of r.mapcalculator. So I write:</div><div><br></div><div><div>grass.mapcalc(&quot;$r_stream_nothin = $r_stream_nothin * $r_mask&quot;,</div><div>                      r_mask = r_mask,</div>
<div>                      r_stream_nothin = r_stream+&#39;_nothin&#39;)</div><div><br></div><div>but I get parse error. What&#39;s the correct way to do this? The aim is to add the suffix &#39;_nothin&#39; to the existing variable name r_stream. </div>
<div>Thank you in advance.</div><div><br></div><div>Regards,</div><div>madi</div><div><br></div>-- <br><span style="color:rgb(102, 102, 102)">Eng. Margherita Di Leo</span><br style="color:rgb(102, 102, 102)"><span style="color:rgb(102, 102, 102)">Ph.D. Candidate</span><br style="color:rgb(102, 102, 102)">
<span style="color:rgb(102, 102, 102)">Methods and Technologies for Environmental Monitoring</span><br style="color:rgb(102, 102, 102)"><span style="color:rgb(102, 102, 102)">Department of Environmental Engineering and Physics (DIFA)</span><br style="color:rgb(102, 102, 102)">
<br style="color:rgb(102, 102, 102)"><span style="color:rgb(102, 102, 102)">University of Basilicata </span><br style="color:rgb(102, 102, 102)"><span style="color:rgb(102, 102, 102)">Campus Macchia Romana</span><br style="color:rgb(102, 102, 102)">
<span style="color:rgb(102, 102, 102)">85100 - Potenza </span><br style="color:rgb(102, 102, 102)"><span style="color:rgb(102, 102, 102)">Italy</span><br style="color:rgb(102, 102, 102)"><br style="color:rgb(102, 102, 102)">
<span style="color:rgb(102, 102, 102)">Office: +39-0971205360</span><br style="color:rgb(102, 102, 102)"><span style="color:rgb(102, 102, 102)"></span><br><br><br>
</div>