ws = r'H:\Documents\ArcGIS\Default.gdb' arcpy.env.workspace = ws rasters = arcpy.ListRasters() for raster in rasters: nodatval = arcpy.GetRasterProperties_management(raster, "ANYNODATA") print str(raster) + " NoData = " + str(nodatval) sys.exit()
desc = arcpy.Describe(raster) desc.noDataValue
Check if the ANYNODATA or ALLNODATA properties of GetRasterPorperties_management will do what you want:
http://resources.arcgis.com/en/help/main/10.1/index.html#//0017000000m7000000
Here is an exmple of running thru the Default.gdb on my system and reporting the raster name and ANYNODATA valuews = r'H:\Documents\ArcGIS\Default.gdb' arcpy.env.workspace = ws rasters = arcpy.ListRasters() for raster in rasters: nodatval = arcpy.GetRasterProperties_management(raster, "ANYNODATA") print str(raster) + " NoData = " + str(nodatval) sys.exit()
If they are multiple bands what are your no data values you are looking for? 0,0,0?
bands = ['Band_1', 'Band_2', 'Band_3'] for band in bands: desc = arcpy.Describe(os.path.join(raster, band)) desc.noDataValue