Mask

サマリー

Creates a raster object by specifying one or more NoData values or a range of valid pixel values.

説明

For more information about how this function works, see the Mask 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.

構文

Mask (raster, {no_data_values}, {included_ranges}, {no_data_interpretation})
パラメーター説明データ タイプ
raster

The input raster.

Raster
no_data_values
[no_data_values,...]

The NoData value or list of values. Values can be type Double or Integer.

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

Double
included_ranges
[included_ranges,...]

The range of valid pixel values to be included in the output raster. Values can be type Double or Integer.

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

Double
no_data_interpretation

Specifies how the NoData values will be displayed in the output raster.

  • 0All—The NoData values you specify for each band must occur in the same cell for the output image to contain the NoData cell.
  • 1Any—If the NoData value you specify occurs for a cell in a specified band, that cell in the output image will be NoData.

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

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

The output raster.

コードのサンプル

Mask example

Masks a NoData value within a specified range of pixel values.

import arcpy

out_Mask_raster = arcpy.sa.Mask("Landsat8.tif", no_data_values = 6, included_ranges = [3,9])