摘要
根据所选的波段子集创建多维栅格或高光谱栅格的子集栅格对象。 输出保持与输入相同的波段顺序。
语法
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 method argument option. The following are examples:
The bands argument is used to specify the bands to extract 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 extract 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 extracted. When specifying bands by wavelength, the units—such as microns or nanometers—are the same as the input units. Subsets using the BY_NAMES option must be a list of individual names delimited by a space, such as band_1 band_2 band_3. Range is not supported for the BY_NAMES option. (默认值为 None) | String |
missing_band_action | Specifies the action that will occur when a band from the bands argument value is not available.
(默认值为 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")