ExtractBand

サマリー

Creates a raster object by extracting one or more bands from, or reordering the bands in, a multiband raster.

説明

For more information about how this function works, see the Extract Bands raster function.

The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.

構文

ExtractBand (raster, {band_ids}, {band_names}, {band_wavelengths}, {missing_band_action}, {wavelength_match_tolerance})
パラメーター説明データ タイプ
raster

The input raster.

Raster
band_ids
[band_ids,...]

Extracts bands using the band ID.

(デフォルト値は次のとおりです None)

Integer
band_names
[band_names,...]

Extracts bands using the name of the bands.

(デフォルト値は次のとおりです None)

String
band_wavelengths
[band_wavelengths,...]

Extracts bands using the band wavelengths.

(デフォルト値は次のとおりです None)

Double
missing_band_action

Specifies the action that will occur when a band within the extract band list is not available.

  • BestMatchThis option will try to find the best available band to use in place of the missing one, so that the function will not fail.
  • FailAny mosaic dataset item that is missing a specified band will fail, since the extract band was invalid.

(デフォルト値は次のとおりです BestMatch)

Integer
wavelength_match_tolerance

Specifies the margin of error when extracting bands using the band_wavelengths method.

(デフォルト値は次のとおりです None)

Double
戻り値
データ タイプ説明
Raster

The output raster.

コードのサンプル

ExtractBand example 1

Extracts bands from the input raster using the band_ids method.

import arcpy

out_bands_raster = arcpy.sa.ExtractBand("in_raster.tif", [1, 2])
ExtractBand example 2

Extracts bands from the input raster using the band_wavelengths method.

import arcpy

out_bands_raster = arcpy.sa.ExtractBand("in_raster.tif", band_wavelengths=[500.00])