I want to simply add two rasters within a python script using map algebra, which from what I understand is the equivalent to adding two rasters in the raster calculator.
If I do this using raster calculator and simply type "Raster1 + Raster2", it works perfectly. However, if I run this in a python script, I get error000732: Input Raster: Dataset Raster1 does not exist or is not supported.
Here is my code:
import arcpy from arcpy import env from arcpy.sa import * raster1 = ("C:/raster1") raster2 = ("C:/raster2") raster3 = Raster("raster1") + Raster("raster2")
I set up the syntax based on the Esri help page for Map Algebra http://desktop.arcgis.com/en/arcmap/latest/extensions/spatial-analyst/map-algebra/an-overview-of-the-rules-for-map-algebra.htm
I'm not sure why my rasters are recognized within the raster calculator but not map algebra.