I am trying to loop through multiple rasters and extract cells that are above 0.1 The code I am trying to use is:
import arcpy
arcpy.CheckOutExtension('Spatial')
arcpy.env.workspace=r'F:\Sheyenne\Atmospherically Corrected Landsat\Indices\Main\NDWI\main_master'
#pathway to all rasters in workspace directory
rasters = arcpy.ListRasters('*.tif*')
for raster in rasters:
#give new file a name
outraster = raster.replace('.tif','_water.tif')
arcpy.gp.RasterCalculator_sa("""raster >= 0.1""",outraster)
print('Done Processing')
For some reason I can't copy and paste the error (python actually shuts down when I run this code) but here is a screen shot of part of it.