# BandArithmetic

## 概要

Performs an arithmetic operation on the bands of a multiband raster object and returns a raster object with the operation applied.

## ディスカッション

For more information about the methods and band orders used with this function, see the Band Arithmetic 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.

## 構文

`BandArithmetic (raster, band_ids, {method})`
 パラメーター 説明 データ タイプ raster The input raster. Raster band_ids The band IDs to use in the arithmetic operation, separated by a space. Band IDs are indexed using one-based indexing, so that the first band in a list of bands in a multiband raster object has an index of 1.The bands should be provided in the order that is required by the arithmetic method. For information about the order of bands needed for each method, see Band Arithmetic. String method The arithmetic operation to apply to the bands.A custom operation can also be defined.1 — NDVI2 —SAVI3 — TSAVI4 —MSAVI5 —GEMI6 —PVI7 —GVITM8 —Sultan9 —VARI10 —GNDVI11 —SR12 —NDVIre13 —SRre14 —MTVI215 —RTVICore16 —CIre17 —CIg18 —NDWI19 —EVI20 —Iron oxide21 —Ferrous minerals22 —Clay minerals23 —WNDWI(デフォルト値は次のとおりです 1) Integer

 データ タイプ 説明 Raster The output raster object with the band arithmetic applied.

## コードのサンプル

BandArithmetic example 1

Calculates the Simple Ratio (SR) for a Landsat 8 image.

``````import arcpy

SimpleRatio = arcpy.sa.BandArithmetic("Landsat8.tif","5 4", 11)``````
BandArithmetic example 2

Calculates a custom operator for a Landsat 8 image.

``````import arcpy