This tool creates a new raster in which each grid cell is equal to the remainder of division of the corresponding grid cells in two input rasters or one input raster and a constant value, i.e. it performs a modulo operation on two numbers. For example, the expression 14 Mod 4 equals 2. If either of the two input numbers is a floating-point value, the floating-point remainder of the division is returned. Because of the imprecision of floating-point storage, the Modulo tool can return an unexpected result when at least one of the operands is floating-point. If the second raster / constant is zero the corresponding grid cell in the output raster will be assigned the NoData value. NoData values in either of the input images will be assigned NoData values in the output image. Notice that the Integer Division tool returns the integer quotient of a division. For example, the expression 14 \ 4 evaluates to 3.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
inputFile1 = wd + "input1.dep"
inputFile2 = wd + "input2.dep"
outputFile = wd + "output.dep"
args = [inputFile1, inputFile2, outputFile]
pluginHost.runPlugin("Modulo", args, False)
This is a Groovy script also using the tool:
def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.dep"
def constant = "5.6"
def outputFile = wd + "output.dep"
String args = [inputFile, constant, outputFile]
pluginHost.runPlugin("Modulo", args, false)