I am kind of new to python but I am trying to batch process single band raster images to create multispectral imageries using arcpy Composite Bands. I have 24 single band rasters (Bands 1 - 3 ) all saved in a single folder which would create 8 composite images after its done. Fortunately the bands are in sequential order for each set, so I can input every three images without having to order them. So far I have:
arcpy.env.workspace = "C:\\Users\\Vinny\\Desktop\\Sentinel2_Scripts\\Unzipped\\Test_Out"
direc = r"C:\\Users\\Vinny\\Desktop\\Sentinel2_Scripts\\Unzipped\\Test_Out"
out_raster = "C:\\Users\\Vinny\\Desktop\\Sentinel2_Scripts\\Unzipped\\Test_Out\\Composite_Bands"
i = 0
rasters = arcpy.ListRasters("*", "JP2")
for raster in rasters:
i+=1
arcpy.CompositeBands_management(raster, out_raster + "\\" + out)
Can you offer any suggestions or ideas?