Hi All,
I have multiple NetCDF files which were converted into tiff files using the tools Make NetCDF Raster Layer & Copy Raster tool in ArcGIS Pro 2.6. As output, I now have multiple tiff files in a folder with many bands inside the tiff files. Here is a screenshot for reference.
As I have multiple tiff files of such kind, I am now trying to come up with a python script that can composite only certain bands.
So if the total number of bands in a tiff file is 365 I only want to composite Band_167 to Band_193.
Here is the snippet that I have worked out so far however, it gives me an error :
ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Failed to create raster dataset
Failed to execute (CompositeBands).
import arcpy
import os
arcpy.env.workspace = r'C:\Vikhyat\Test'
Input = arcpy.env.workspace
Output = r'C:\Vikhyat\Data\Stack'
for img in Input:
name = os.path.join(Output, img[0].split("_")[0] + ".tif")
arcpy.CompositeBands_management('Rainfall__Clim_Pred_LRF_New_RF25_IMD0p252001.tif/Band_167;Rainfall__Clim_Pred_LRF_New_RF25_IMD0p252001.tif/Band_168;Rainfall__Clim_Pred_LRF_New_RF25_IMD0p252001.tif/Band_169;Rainfall__Clim_Pred_LRF_New_RF25_IMD0p252001.tif/Band_170', name)
print('Finished')
I have tried to use arcpy.CompositeBands_management on individual bands which are in tiff format and it worked successfully.
Hence, any inputs on what I might be missing would be helpful.