According to the following conversation: Using r.mapcalculator in Python console?
I tried:
##NoData Background=name
##RASTERLAYER_BAND=raster
##nodatabackground=output raster
import processing
ext = RASTERLAYER_BAND.extent()
a = str(ext.xMinimum())
b = str(ext.xMaximum())
c = str(ext.yMinimum())
d = str(ext.yMaximum())
size = a + ',' + b + ',' + c + ',' + d
nodatabackground=processing.runalg('grass:r.mapcalculator', RASTERLAYER_BAND,None,None,None,None,None,'A/A*A',size,0.0,nodatabackground)
But it doesn't work to me. I get the following message: AttributeError: 'unicode' object has no attribute 'extent'
Any idea to solve it?