SubsetBands
汇总
根据所选的波段子集创建多维栅格或高光谱栅格的子集栅格对象。 输出保持与输入相同的波段顺序。
讨论
栅格对象所引用的栅格数据集是临时性的。 要将其设置为永久,可以调用栅格对象的 save 方法。
有关此函数工作原理的详细信息,请参阅 子集化波段 栅格函数。
语法
SubsetBands(raster, {method}, {bands}, {missing_band_action}, {exclude_bad_bands})
| 参数 | 说明 | 数据类型 |
|---|---|---|
|
raster |
The input hyperspectral or multidimensional raster. |
Raster |
|
method |
Specifies the method that will be used to extract and create the subset of the bands.
(默认值为 BY_IDS) |
String |
|
bands |
The bands that will be extracted based on the specified
The When specifying the When specifying bands by wavelength, the units—such as microns or nanometers—are the same as the input units. Subsets using the (默认值为 None) |
String |
|
missing_band_action |
Specifies the action that will occur when a band from the
(默认值为 BestMatch) |
String |
|
exclude_bad_bands |
Specifies whether bands that have been flagged as bad will be excluded.
(默认值为 False) |
Boolean |
返回值
| 数据类型 | 说明 |
|---|---|
|
Raster |
输出子集栅格。 |
代码示例
此示例使用 BY_IDS 选项从输入栅格中提取波段。
extracted_bands = arcpy.ia.SubsetBands(raster=img_lyr, method="BY_IDS", bands="100 105 110 120-130")
此示例使用 BY_NAMES 选项从输入栅格中提取波段。
extracted_bands = arcpy.ia.SubsetBands(raster=img_lyr, method="BY_NAMES", bands="band_15 band_13 band_14")
此示例使用 BY_WAVELENGTHS 选项从输入栅格中提取波段。
extracted_bands = arcpy.ia.SubsetBands(raster=img_lyr, method="BY_WAVELENGTHS", bands="400-700 900")