I'm doing some DTM processing, the first couple of stages are a slope calculation and then a Raster calculator process using QGIS's native raster calculator. I want to use the output layer from my slope calculation within the formula. Slope is done as follows, and works fine:
Slope = processing.run("native:slope", {
'INPUT':set_NoData_toNull['OUTPUT'], #There is a step before, Nullifying <0 values
'Z_FACTOR':1,
'OUTPUT': 'TEMPORARY_OUTPUT' })
The calculator is to then remove any Raster values lower than a 45 degree slope, this formula works when using on a named Raster layer and replacing the @1 with "layername@1", but to save processing power I dont want to save the output of "Slope" every time i run this script, and instead want to use the 'TEMPORARY_OUTPUT' of "Slope", though after much reading I still can't work out how I should Call this in the Raster Calculator 'EXPRESSION' field.
calculatedOver45deg = processing.run("qgis:rastercalculator", {
'EXPRESSION':'((\"@1\">45)*\"@1\") / ((\"@1\">45)*1 + (\"@1\"<=45)*0)',
'LAYERS': Slope['OUTPUT'],
'CELLSIZE':None,
'EXTENT':None,
'CRS':QgsCoordinateReferenceSystem('EPSG:32633'),
'OUTPUT': 'TEMPORARY_OUTPUT' })
Does anyone know what 'TEMPORARY_OUTPUT' from slope is named and therefore how it can be used in the expression in replacement of @1.
Thanks