ERROR 000271: Cannot open the input datasets Failed to execute (CompositeBands) (arcp

المشرف العام

Administrator
طاقم الإدارة
I am trying to stack bands 3 and 4 together for numerous landsat scenes, and I am trying to do it using a loop and arcpy.CompositeBands_management. The code I am using is:

import arcpy#set environmentarcpy.env.workspace=r'F:\Sheyenne\Atmospherically Corrected Landsat\hank_masked\NDVI'#path to band 3band3 = arcpy.ListRasters("*band3*")#path to band 4band4 = arcpy.ListRasters("*band4*")#loop that matches raster names and only executes process for those that matchfor raster in band3: rasterName = raster rasterMask = "" #initialize your variable to be populated in the inner loop for band in band4: if band.startswith(rasterName.split("_")[0]): stack = band break #break out of the inner loop - we have a match if stack != "": #just to make sure we have something #generic naming outraster = rasterName.replace(".tif", "_stacked.tif") arcpy.CompositeBands_management('rasterName;rasterMask',outraster)print('Done Processing')but this returns the error:

ExecuteError: ERROR 000271: Cannot open the input datasetsFailed to execute (CompositeBands).I am thinking it has something to do with this line:

arcpy.CompositeBands_management('rasterName;rasterMask',outraster)If i take the ' out of this line it still won't work though



أكثر...
 
أعلى