Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

composite bands cannot open input dataset

$
0
0
Hello,

I have been trying to composite 3 bands and keep getting this error message:

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

I have run several small tests to see if my names were OK - they seem to be.

I have also tried compositing tiffs, grids in a folder and grids in a file geodatabase. I get the message every time. I don't see anything in the CompositeBands description that indicates my parameters are off.

Do any of you have some ideas?

Here is the code:

Code:

()

#import system modules
import arcpy, os
from arcpy import env
arcpy.env.workspace = r"C:/FINAL/data.gdb"

#overwrite files with the same name
env.overwriteOutput = True

#list the rasters to be used
#rasters in the geodatabase that start with 't' are 4-band images
rasters= arcpy.ListDatasets("t*", "Raster")
#rasters that start with ,p, are 4-band PCA results
PCA= arcpy.ListDatasets("p*", "Raster")

#make a combination of bands 1,4 and 2nd PC

for raster in rasters:
    raster1= raster + "/Band_1"
    raster4= raster + "/Band_4"
    r_index= raster[1] + raster[3] 
    for component in PCA:
        p2= (component, "/Band_2")
        print "processing: " + r_index
        outRaster = ("b14p" + r_index)     
       
        if r_index == component[1:3]:
            arcpy.CompositeBands_management("raster1; raster4; p2", outRaster)

           
           
print "Composites complete"

#

Maybe there's a work-around?

Thanks for any insight.

Kat

edit: I forgot to say that I am using ArcGIS 10.0 sp1 and that I am running the script as a stand-alone.

Also, I am using Python (IDLE) 2.6.5

Viewing all articles
Browse latest Browse all 2485

Trending Articles