>>> import arcpy
... from arcpy.sa import*
... arcpy.CheckOutExtension ("Spatial")
... u'CheckedOut'
... arcpy.env.overwriteOutput = True
... arcpy.env.workspace = r'I:\Test_Delete\AQUA_D'
... inws = arcpy.env.workspace
... inws1 = r'I:\Test_Delete\AQUA_N'
... outws = r'I:\Test_Delete\OUTPUT'
... rasters = arcpy.ListRasters()
... for r in rasters:
... prefix = os.path.splitext(r)[0]
... suffix = os.path.splitext(r)[1]
... prefix1 = prefix.rstrip("Aqua_D")
... raster2 = os.path.join(inws1, prefix1 + "Aqua_N" + suffix)
... print raster2
... outraster = os.path.join(outws, prefix1 + "mean" + suffix)
... print outraster
... outCellStatistics = CellStatistics([arcpy.sa.Raster(r), arcpy.sa.Raster(raster2)], "MEAN")
... outCellStatistics.save(outraster)
I'm using these codes to generate Cell-Statistics, as everyone using it here.
I have data in four different folders,
but right now I'm using two folders just for the testing but I couldn't get the result.
I'm a beginner level of Python user. So, Help me out with this code.
I'm getting this kind of error again and again:
...
I:\Test_Delete\AQUA_N\clip1_A2002185Aqua_N.tif
I:\Test_Delete\OUTPUT\clip1_A2002185mean.tif
Runtime error
Traceback (most recent call last):
File "<string>", line 19, in <module>
RuntimeError: ERROR 000732: Input Raster: Dataset I:\Test_Delete\AQUA_N\clip1_A2002185Aqua_N.tif does not exist or is not supported
I have tried everything but still coudn't find the result.
... View more