The Decrement tool decreases the grid cell values in an input raster file by the corresponding grid cell values in a second raster or by a user-specified constant value. Notice that if the specified decrement raster is a Boolean (i.e. contains only 1's and 0's), or a constant value of 1 is specified, then the result is the traditional decrement (--) operation. If a value other than 1 is used, then the tool outputs the result of an Subtraction AND Assignment (-=) operator. The only difference between this tool and the Subtract tool is that Subtract outputs to a new raster, whereas Decrement simply updates the input raster. This tool is paired with the Increment tool, which can be used to increase the grid cell values in a raster.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input1.dep"
decrementFile = wd + "input2.dep"
args = [inputFile, decrementFile]
pluginHost.runPlugin("Decrement", args, False)
This is a Groovy script also using the tool:
def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.dep"
def decrementValue = "5"
String[] args = [inputFile, decrementValue]
pluginHost.runPlugin("Decrement", args, false)