Summary
Creates a raster object that labels bad bands in a multidimensional or hyperspectral raster based on a selected subset of bands. The output maintains the same band order as the input.
Discussion
This function allows you to specify a set of bands using ranges or lists to be labeled as bad. The output will have the band property IsBadBand set to 1. The property will be created if it does not already exist. This function supports both multispectral and hyperspectral images, and maintains the same band order as input.
The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.
For more information about how this function works, see the Label Bad Bands raster function.
Syntax
LabelBadBands (raster, {method}, {bands})
Parameter | Explanation | Data Type |
raster | The input multidimensional or hyperspectral image. | Raster |
method | Specifies the method that will be used to label bad bands in the input image.
(The default value is BY_IDS) | String |
bands | The bands that will be labeled as bad bands based on the specified method argument option. The following are examples:
The bands argument specifies the bands that will be labeled as bad bands and depends on the method option specified. The bands are entered as a space-delimited list and can be specified as ranges of bands. For example, when specifying a subset using the BY_IDS option for the method parameter, a value of 20-50 60-100 200 will label band IDs between (inclusive) 20 and 50, 60 and 100, and a band with an ID of 200. When specifying the bands parameter value using the BY_WAVELENGTHS option for the method argument, all bands within the wavelength range will be labeled. When specifying bands by wavelength, the units—such as microns or nanometers—will be the same as the input units. (The default value is None) | String |
Data Type | Explanation |
Raster | The output image with bad bands labeled. |
Code sample
This example extracts the bands from the input raster using the BY_IDS option.
labeled_bands = arcpy.ia.LabelBadBands(raster=img_lyr, method="BY_IDS", bands="100 105 110 120-130")
This example extracts the bands from the input raster using the BY_WAVELENGTH option.
labeled_bands = arcpy.ia.LabelBadBands(raster=img_lyr, method="BY_WAVELENGTHS", bands="400-700")