I've been trying to write a script creating binary maps:
a=raw_input ("enter a threshold") b=float(a) grass.run_command('r.mapcalculator', formula="**'base_map'>=b**", outfile='map'+str(a), overwrite=True)
When I'm trying to execute it there's an error message :
Invalid map Parse error
Obviously, when the relevant part of the code is changed (e.g.
formula="'base_map'>=**0.7**") everything is working fine. However, my goal was to write a script creating a map automatically when the "a" (the threshold) is provided.