LabelBadBands

摘要

根据所选的波段子集创建多维栅格或高光谱栅格错误波段的栅格对象。 输出保持与输入相同的波段顺序。

说明

此函数允许您使用范围或列表指定一组要标记为错误波段的波段。 输出将把波段属性 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—The band designation or sequence number will be used to label bad bands in the input image.
  • BY_WAVELENGTHS—Band wavelengths on the electromagnetic spectrum 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:

  • Using the BY_IDS option for the method argument, specify '100 105 110 120-130'. Values will be minus by 1 for a 0-based index.
  • Using the BY_WAVELENGTHS option for the method argument, specify '400-480 900'.

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

标注带错误波段的输出图像。

代码示例

LabelBadBands 示例 1

此示例使用 BY_IDS 选项从输入栅格中提取波段。

labeled_bands = arcpy.ia.LabelBadBands(raster=img_lyr, method="BY_IDS", bands="100 105 110 120-130")
LabelBadBands 示例 2

此示例使用 BY_WAVELENGTH 选项从输入栅格中提取波段。

labeled_bands = arcpy.ia.LabelBadBands(raster=img_lyr, method="BY_WAVELENGTHS", bands="400-700")