The Raster Calculator enables the user to perform complex mathematical calculation on rasters. The user can build expressions using large variety of arithmetic, logical, trigonometric, etc. functions provided. Up to 4 rasters can be used in a single expression. The expressions are evaluated by the Raster Calculator on the fly and the user is provided with the status of the formula as he/her builds it.

| Priority | Operators |
|---|---|
| 1 | AND, OR, XOR |
| 2 | ==, !=, <=, >=, <, > |
| 3 | +, - |
| 4 | *, / |
| 5 | ^ |
Parameters
| Expression | Explanation |
|---|---|
| Function Name | RasterCalculator |
| <Raster_A> | A String representing a raster dataset. |
| {Raster_B} | A String representing a raster dataset. |
| {Raster_C} | A String representing a raster dataset. |
| {Raster_D} | A String representing a raster dataset. |
| <output raster> | A String - the full name of the output raster. |
| <expression> | A String - the expression to be executed. |
ETSPath used in the table below is the full path to ETSRun.exe (E.G. "C:\Program Files\ETSpatial Techniques\ETSurface\ETSRun.exe")
| Language | Syntax |
|---|---|
| Python | subprocess.call([ETSPath, "RasterCalculator", "Raster_A", "Raster_B", "Raster_C", "Raster_D", "output raster", "expression"]) |
| .NET using ETSRun.exe | StartInfo.FileName = ETSPath StartInfo.Arguments = "RasterCalculator" "Raster_A" "Raster_B" "Raster_C" "Raster_D" "output raster" "expression" |
| .NET using ETSOutX.dll | RasterCalculator(Raster_A, Raster_B, Raster_C, Raster_D, output raster, expression) |
| ArcPy | arcpy.RasterCalculator("Raster_A", "Raster_B", "Raster_C", "Raster_D", "output raster", "expression") |
Notes:
<> - required parameter
{} - optional parameter
The argument separator for StartInfo.Arguments is space. If a string might contain a space, you need to double quote it.