Wednesday 5 February 2020

arcgis desktop - How to separate raster bands in ModelBuilder?


I have a simple model that iterates through folders to collect imagery, mosaics them and clips the mosaic to a study area boundary. I need to produce an NDVI from the clipped 4-band mosaic "sa11_4band.tif" by incorporating the raster calculator into the model. The problem I am encountering is that the individual bands do not appear in the raster calculator when I incorporate the raster calculator tool. How should I separate the raster bands from "sa11_4band.tif" in order to perform the necessary calculation in the raster calculator?:


Float("sa11_4band.tif - Band_4"-"sa11_4band.tif - Band_3")/Float("sa11_4band.tif - Band_4" + "sa11_4band.tif - Band_3") 

enter image description here



Answer



Typically with most ArcGIS raster tools if you need to access an individual band you refer to it as an extension to the file name.


For example: c:\path\to\my\raster.tif\band1



I haven't had to use this since 9.3, but it definitely worked in the calculator then. I never used it in a model, but it should work the same since the model is just calling the calculator tool.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...