摘要
根据所选的波段子集创建多维栅格或高光谱栅格错误波段的栅格对象。 输出保持与输入相同的波段顺序。
说明
此函数允许您使用范围或列表指定一组要标记为错误波段的波段。 输出将把波段属性 IsBadBand 设置为 1。 如果该属性尚不存在,则会创建该属性。 此函数支持多光谱和高光谱影像,并且保持与输入相同的波段顺序。
栅格对象所引用的栅格数据集是临时性的。 要将其设置为永久,可以调用栅格对象的 save 方法。
有关此函数工作原理的详细信息,请参阅标注错误波段栅格函数。
语法
LabelBadBands (raster, {method}, {bands})
参数 | 说明 | 数据类型 |
raster | The input multidimensional or hyperspectral image. | Raster |
method | Specifies the method that will be used to label bad bands in the input image.
(默认值为 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. (默认值为 None) | String |
数据类型 | 说明 |
Raster | 标注带错误波段的输出图像。 |
代码示例
此示例使用 BY_IDS 选项从输入栅格中提取波段。
labeled_bands = arcpy.ia.LabelBadBands(raster=img_lyr, method="BY_IDS", bands="100 105 110 120-130")
此示例使用 BY_WAVELENGTH 选项从输入栅格中提取波段。
labeled_bands = arcpy.ia.LabelBadBands(raster=img_lyr, method="BY_WAVELENGTHS", bands="400-700")