Based on the "Error when using r.series in a python script" discussion (Error when using r.series in a python script) and based upon the solution given by Joseph I tried to make the same but by using a loades set of rasters and saving the result as temporary file. I made the following script but it doesn't work to me. Any Idea to fix it?
##RasterMaxFinder=name
##1=multiple raster
##maximum=output raster
import glob, os, processing
from PyQt4.QtCore import QFileInfo
from qgis.core import QgsRasterLayer, QgsRectangle
raster = processing.getObject(1)
list = []
extent = QgsRectangle()
extent.setMinimal()
for raster in 1:
fileInfo = QFileInfo(raster)
baseName = fileInfo.baseName()
rlayer = QgsRasterLayer(raster, baseName)
# Combine raster layers to list
list.append(rlayer)
# Combine raster extents
extent.combineExtentWith(rlayer.extent())
# Get extent
xmin = extent.xMinimum()
xmax = extent.xMaximum()
ymin = extent.yMinimum()
ymax = extent.yMaximum()
# Run algorithm
processing.runalg('grass:r.series', list ,False,6,'-10000000000,10000000000',"%f,%f,%f,%f"% (xmin, xmax, ymin, ymax),0.0, maximum)