I am trying to reclassify a bunch of rasters, but when I run my script arcGIS crash. What I want to do, is reclassify rasters this way: every accepted value (0,1,5 and 64) to 1, and the others values just assign "NODATA". By this way, every processed raster would be like a binary raster, just values 1 and "NODATA". The value 1 is because I need to multiply this raster with other raster, acting like a mask. Maybe, I need to reclassify to logical raster (TRUE/FALSE values).
I suppose this problem is caused because every raster could have or not all accepted values, so when I run my script, the actual raster perhaps don't have one of the accepted values, so it crash.
My script is this:
import arcpy, os from arcpy import env from arcpy.sa import * env.workspace = "C:/Data/modis_arc/processed/CHL3" rasterlist = arcpy.ListRasters("*", "TIF") for raster in rasterlist: clt_name = os.path.join("C:/Data/modis_arc/processed/CHL3/reclass2/", raster) outReclass1 = Reclassify(raster, "Value", RemapValue([[0,1],[1,1],[5,1],[64,1]]), "NODATA") outReclass1.save(clt_name)