# arcgis.raster.functions module¶

Raster functions allow you to define processing operations that will be applied to one or more rasters. These functions are applied to the raster data on the fly as the data is accessed and viewed; therefore, they can be applied quickly without having to endure the time it would otherwise take to create a processed product on disk, for which raster analytics tools like arcgis.raster.analytics.generate_raster can be used.

Functions can be applied to various rasters (or images), including the following:

• Imagery layers

• Rasters within imagery layers

## abs¶

arcgis.raster.functions.abs(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Abs operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## acos¶

arcgis.raster.functions.acos(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The acos operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## acosh¶

arcgis.raster.functions.acosh(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The ACosH operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## aggregate_cells¶

arcgis.raster.functions.aggregate_cells(raster, cell_factor=2, aggregation_type=9, extent_handling=False, ignore_nodata=False)

Generates a reduced-resolution version of a raster.

Parameters
• raster – the input raster

• cell_factor – The factor by which to multiply the cell size of the input raster to obtain the desired resolution for the output raster. For example, a cell factor value of three would result in an output cell size three times larger than that of the input raster. The value must be an integer greater than 1.

• aggregation_type

Optional int. Establishes how the value for each output cell will be determined. The values of the input cells encompassed by the coarser output cell are aggregated by one of the following statistics:

• 2 (MAXIMUM) : The largest value of the input cells.

• 3 (MEAN) : The average value of the input cells.

• 4 (MEDIAN) : The median value of the input cells.

• 5 (MINIMUM) : The smallest value of the input cells.

• 9 (SUM) : The sum (total) of the input cell values.This is the default.

• extent_handling

Optional boolean. Defines how to handle the boundaries of the input raster when its rows or columns are not a multiple of the cell factor.

• True : Expands the top or right boundaries of the input raster so the total number of cells in a row or column is a multiple of the cell factor. Those expanded cells are given a value of NoData. With this option, the output raster can cover a larger spatial extent than the input raster. This is the default.

• False : Reduces the number of rows or columns in the output raster by 1. This will truncate the remaining cells on the top or right boundaries of the input raster, making the number of rows or columns in the input raster a multiple of the cell factor. With this option, the output raster can cover a smaller spatial extent than the input raster.

• ignore_nodata

Optional boolean. Denotes whether NoData values are ignored by the aggregation calculation.

• True : Specifies that if NoData values exist for any of the cells that fall within the spatial extent of a larger cell on the output raster, the NoData values will be ignored when determining the value for output cell locations. Only input cells within the extent of the output cell that have data values will be used in determining the value of the output cell. This is the default.

• False : Specifies that if any cell that falls within the spatial extent of a larger cell on the output raster has a value of NoData, the value for that output cell location will be NoData.When the this option is used, it is implied that when cells within an aggregation contain the NoData value, there is insufficient information to perform the specified calculations necessary to determine an output value.

Returns

output raster

## apply¶

arcgis.raster.functions.apply(raster, fn_name, **kwargs)

Applies a server side raster function template defined by the imagery layer (image service) The name of the raster function template is available in the imagery layer properties.rasterFunctionInfos.

Function arguments are optional; argument names and default values are created by the author of the raster function template and are not known through the API. A client can simply provide the name of the raster function template only or, optionally, provide arguments to overwrite the default values. For more information about authoring server-side raster function templates, see <a href=”http://server.arcgis.com/en/server/latest/publish-services/windows/server-side-raster-functions.htm”>Server-side raster functions</a>.

Parameters
• raster – the input raster, or imagery layer

• fn_name – name of the server side raster function template, See imagery layer properties.rasterFunctionInfos

• kwargs – keyword arguments to override the default values of the raster function template, including astype

Returns

the output raster

## arg_max¶

arcgis.raster.functions.arg_max(rasters, undefined_class=None, astype=None)

In the ArgMax method, all raster bands from every input raster are assigned a 0-based incremental band index, which is first ordered by the input raster index, as shown in the table below, and then by the relative band order within each input raster.

Parameters
• rasters – the imagery layers filtered by where clause, spatial and temporal filters

• undefined_class – int, required

Returns

the output raster with this function applied to it

## arg_median¶

arcgis.raster.functions.arg_median(rasters, undefined_class=None, astype=None)

The ArgMedian method returns the Band index for which the given pixel attains the median value of values from all bands.

Consider values from all bands as an array. After sorting the array in ascending order, the median is the one value separating the lower half of the array from the higher half. More specifically, if the ascend-sorted array has n values, the median is the ith (0-based) value, where: i = ( (n-1) / 2 )

Parameters
• rasters – the imagery layers filtered by where clause, spatial and temporal filters

• undefined_class – int, required

Returns

the output raster with this function applied to it

## arg_min¶

arcgis.raster.functions.arg_min(rasters, undefined_class=None, astype=None)

ArgMin is the argument of the minimum, which returns the Band index for which the given pixel attains its minimum value.

Parameters
• rasters – the imagery layers filtered by where clause, spatial and temporal filters

• undefined_class – int, required

Returns

the output raster with this function applied to it

## arg_statistics¶

arcgis.raster.functions.arg_statistics(rasters, stat_type=None, min_value=None, max_value=None, undefined_class=None, astype=None)

The arg_statistics function produces an output with a pixel value that represents a statistical metric from all bands of input rasters. The statistics can be the band index of the maximum, minimum, or median value, or the duration (number of bands) between a minimum and maximum value

Parameters
• rasters – the imagery layers filtered by where clause, spatial and temporal filters

• stat_type – one of “max”, “min”, “median”, “duration”

• min_value – double, required if the type is duration

• max_value – double, required if the type is duration

• undefined_class – int, required if the type is maximum or minimum

Returns

the output raster with this function applied to it

## arithmetic¶

arcgis.raster.functions.arithmetic(raster1, raster2, extent_type='FirstOf', cellsize_type='FirstOf', astype=None, operation_type=1)

The Arithmetic function performs an arithmetic operation between two rasters or a raster and a scalar, and vice versa.

Parameters
• raster1 – the first raster- imagery layers filtered by where clause, spatial and temporal filters

• raster2 – the 2nd raster - imagery layers filtered by where clause, spatial and temporal filters

• extent_type – one of “FirstOf”, “IntersectionOf” “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf “MeanOf”, “LastOf”

• operation_type – int 1 = Plus, 2 = Minus, 3 = Multiply, 4=Divide, 5=Power, 6=Mode

Returns

the output raster with this function applied to it

## asin¶

arcgis.raster.functions.asin(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The asin operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## asinh¶

arcgis.raster.functions.asinh(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The ASinH operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## aspect¶

arcgis.raster.functions.aspect(raster)

aspect identifies the downslope direction of the maximum rate of change in value from each cell to its neighbors. Aspect can be thought of as the slope direction. The values of the output raster will be the compass direction of the aspect. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/aspect-function.htm”>Aspect function</a> and <a href=”http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/how-aspect-works.htm”>How Aspect works</a>.

Parameters

raster – the input raster / imagery layer

Returns

aspect applied to the input raster

## atan¶

arcgis.raster.functions.atan(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The ATan operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## atan2¶

arcgis.raster.functions.atan2(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The ATan2 operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## atanh¶

arcgis.raster.functions.atanh(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The ATanH operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## band_arithmetic¶

arcgis.raster.functions.band_arithmetic(raster, band_indexes=None, astype=None, method=0)

The band_arithmetic function performs an arithmetic operation on the bands of a raster. For more information, see Band Arithmetic function at http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/band-arithmetic-function.htm

Parameters
• raster – the input raster / imagery layer

• band_indexes – band indexes or expression. Band indexes can be given as a space seperated string or a list of integers or floating point values. e.g., “4 3” or [4,3]. For user defined methods the band index can be given as an expression such as “(B3 - B1)/(B3 + B1)”

• astype – output pixel type

• method – int. The type of band arithmetic algorithm you want to deploy. You can define your custom algorithm, or choose a predefined index. 0 = UserDefined, 1 = NDVI, 2 = SAVI, 3 = TSAVI, 4 = MSAVI, 5 = GEMI, 6 = PVI, 7 = GVITM, 8 = Sultan, 9 = VARI, 10 = GNDVI, 11 = SR, 12 = NDVIre, 13 = SRre, 14 = MTVI2, 15 = RTVICore, 16 = CIre, 17 = CIg, 18 = NDWI, 19 = EVI, 20 = IronOxide, 21 = FerrousMinerals, 22 = ClayMinerals, 23 = WNDWI

Returns

band_arithmetic applied to the input raster

## bitwise_and¶

arcgis.raster.functions.bitwise_and(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BitwiseAnd operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## bitwise_left_shift¶

arcgis.raster.functions.bitwise_left_shift(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BitwiseLeftShift operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## bitwise_not¶

arcgis.raster.functions.bitwise_not(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BitwiseNot operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## bitwise_or¶

arcgis.raster.functions.bitwise_or(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BitwiseOr operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## bitwise_right_shift¶

arcgis.raster.functions.bitwise_right_shift(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BitwiseRightShift operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## bitwise_xor¶

arcgis.raster.functions.bitwise_xor(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BitwiseXOr operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## boolean_and¶

arcgis.raster.functions.boolean_and(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BooleanAnd operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## boolean_not¶

arcgis.raster.functions.boolean_not(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BooleanNot operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## boolean_or¶

arcgis.raster.functions.boolean_or(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BooleanOr operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## boolean_xor¶

arcgis.raster.functions.boolean_xor(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The BooleanXOr operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## cire¶

arcgis.raster.functions.cire(raster, band_indexes='7 6', astype=None)

The Chlorophyll Index - Red-Edge (CIre) is a vegetation index for estimating the chlorophyll content in leaves using the ratio of reflectivity in the near-infrared (NIR) and red-edge bands.

CIre = [(NIR / RedEdge)-1]

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR RedEdge”, e.g., “7 6” or [7,6]

• astype – output pixel type

Returns

output raster

## cig¶

arcgis.raster.functions.cig(raster, band_indexes='7 3', astype=None)

The Chlorophyll Index - Green (CIg) is a vegetation index for estimating the chlorophyll content in leaves using the ratio of reflectivity in the near-infrared (NIR) and green bands.

CIg = [(NIR / Green)-1]

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR Green”, e.g., “7 3” or [7,3]

• astype – output pixel type

Returns

output raster

## classify¶

arcgis.raster.functions.classify(raster1, raster2=None, classifier_definition=None, astype=None)

classifies a segmented raster to a categorical raster.

Parameters
• raster1 – the first raster - imagery layers filtered by where clause, spatial and temporal filters

• raster2 – Optional segmentation raster - If provided, pixels in each segment will get same class assignments. imagery layers filtered by where clause, spatial and temporal filters

• classifier_definition – the classifier parameters as a Python dictionary / json format

Returns

the output raster with this function applied to it

## clay_minerals¶

arcgis.raster.functions.clay_minerals(raster, band_indexes='6 7', astype=None)

The Clay Minerals (CM) ratio is a geological index for identifying mineral features containing clay and alunite using two shortwave infrared (SWIR) bands. CM is used in mineral composite mapping.

CM = SWIR1 / SWIR2

Parameters
• raster – the input raster / imagery layer

• band_indexes – “SWIR1 SWIR2”, e.g., “6 7” or [6,7]

• astype – output pixel type

Returns

output raster

## clip¶

arcgis.raster.functions.clip(raster, geometry=None, clip_outside=True, astype=None)

Clips a raster using a rectangular shape according to the extents defined or will clip a raster to the shape of an input polygon. The shape defining the clip can clip the extent of the raster or clip out an area within the raster.

Parameters
• raster – input raster

• geometry – clipping geometry

• clip_outside – boolean, If True, the imagery outside the extents will be removed, else the imagery within the clipping_geometry will be removed.

• astype – output pixel type

Returns

the clipped raster

## colormap¶

arcgis.raster.functions.colormap(raster, colormap_name=None, colormap=None, colorramp=None, astype=None)

Transforms the pixel values to display the raster data as a color (RGB) image, based on specific colors in a color map. For more information, see Colormap function at http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/colormap-function.htm

Parameters
• raster – input raster

• colormap_name – colormap name, if one of Random | NDVI | Elevation | Gray

• colormap

[ [<value1>, <red1>, <green1>, <blue1>], //[int, int, int, int] [<value2>, <red2>, <green2>, <blue2>] ],

• colorramp – Can be a string specifiying color ramp name like <Black To White|Yellow To Red|Slope|more..> or a color ramp object. For more information about colorramp object, see color ramp object at http://resources.arcgis.com/en/help/arcgis-rest-api/#/Color_ramp_objects/02r3000001m0000000/)

• astype – output pixel type

Returns

the colorized raster

## colormap_to_rgb¶

arcgis.raster.functions.colormap_to_rgb(raster)

” The function is designed to work with single band image service that has internal colormap. It will convert the image into a three-band 8-bit RGB raster. This function takes no arguments except an input raster. For qualified image service, there are two situations when ColormapToRGB function is automatically applied: The “colormapToRGB” property of the image service is set to true; or, client asks to export image into jpg or png format. For more information, see http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/colormap-to-rgb-function.htm)

Parameters

raster – the input raster / imagery layer

Returns

Three band raster

## colorspace_conversion¶

arcgis.raster.functions.colorspace_conversion(raster, conversion_type='rgb_to_hsv')

The ColorspaceConversion function converts the color model of a three-band unsigned 8-bit image from either the hue, saturation, and value (HSV) to red, green, and blue (RGB) or vice versa. An ExtractBand function and/or a Stretch function are sometimes used for converting the imagery into valid input of ColorspaceConversion function. For more information, see http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/color-model-conversion-function.htm

Parameters
• raster – the input raster

• conversion_type – sting type, one of “rgb_to_hsv” or “hsv_to_rgb”. Default is “rgb_to_hsv”

Returns

the output raster with this function applied to it

## complex¶

arcgis.raster.functions.complex(raster)

Complex function computes magnitude from complex values. It is used when input raster has complex pixel type. It computes magnitude from complex value to convert the pixel type to floating point for each pixel. It takes no argument but an optional input raster. For more information, see http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/complex-function.htm

Parameters

raster – the input raster / imagery layer

Returns

Output raster obtained after applying the function

## composite_band¶

arcgis.raster.functions.composite_band(rasters, astype=None)

Combines multiple images to form a multiband image.

Parameters
• rasters – input rasters

• astype – output pixel type

Returns

the multiband image

## con¶

arcgis.raster.functions.con(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)
The con operation.Performs a conditional if/else evaluation on each of the input cells of an input raster.

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

USAGE EXAMPLE: To extract raster from flow direction raster layer that only covers the watershed.
rasters:
["Input raster representing the true or false result of the desired condition. It can be of integer or floating point type.",
"The input whose values will be used as the output cell values if the condition is true. It can be an integer or a floating point raster, or a constant value.",
"The input whose values will be used as the output cell values if the condition is false. It can be an integer or a floating point raster, or a constant value."]

con([stowe_watershed_lyr, Stowe_fill_flow_direction_lyr, 0])


## constant_raster¶

arcgis.raster.functions.constant_raster(constant, raster_info, gis=None)

Creates a virtual raster with a single pixel value.

Parameters
• constant – Required list. The value of the constant to be added to the virtual raster.

• raster_info

Required Raster info dictionary or ImageryLayer object to set the properties of the output raster. if ImageryLayer is specified then the raster information is obtained from the ImageryLayer specified.

Example for RasterInfo dict -

{‘bandCount’: 3,’extent’: {“xmin”: 4488761.95, “ymin”: 5478609.805, “xmax”: 4489727.05, “ymax”: 5479555.305, “spatialReference”: { “wkt”: “PROJCS[“Deutsches_Hauptdreiecksnetz_Transverse_Mercator”, GEOGCS[“GCS_Deutsches_Hauptdreiecksnetz”,DATUM[“D_Deutsches_Hauptdreiecksnetz”, SPHEROID[“Bessel_1841”,6377397.155,299.1528128]],PRIMEM[“Greenwich”,0.0], UNIT[“Degree”,0.0174532925199433]],PROJECTION[“Transverse_Mercator”], PARAMETER[“false_easting”,4500000.0],PARAMETER[“false_northing”,0.0], PARAMETER[“central_meridian”,12.0],PARAMETER[“scale_factor”,1.0], PARAMETER[“latitude_of_origin”,0.0],UNIT[“Meter”,1.0]]” }}, ‘pixelSizeX’: 0.0999999999999614, ‘pixelSizeY’: 0.1, ‘pixelType’: ‘U8’}

• gis – Optional gis. gis parameter can be specified to render the output raster dynamically using the raster rendering service of the gis. If not provided, active gis will be used to do this. If gis parameter is not specified the output of constant_raster() cannot be displayed.

Returns

output raster

## contrast_brightness¶

arcgis.raster.functions.contrast_brightness(raster, contrast_offset=2, brightness_offset=1, astype=None)

The ContrastBrightness function enhances the appearance of raster data (imagery) by modifying the brightness or contrast within the image. This function works on 8-bit input raster only.

Parameters
• raster – input raster

• contrast_offset – double, -100 to 100

• brightness_offset – double, -100 to 100

• astype – pixel type of result raster

Returns

output raster

## convolution¶

arcgis.raster.functions.convolution(raster, kernel=None, astype=None)

The Convolution function performs filtering on the pixel values in an image, which can be used for sharpening an image, blurring an image, detecting edges within an image, or other kernel-based enhancements. For more information,

Parameters
• raster – input raster

• kernel – well known kernel from arcgis.raster.kernels or user defined kernel passed as a list of list

• astype – pixel type of result raster

Returns

output raster

## cos¶

arcgis.raster.functions.cos(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Cos operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## cosh¶

arcgis.raster.functions.cosh(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The CosH operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## curvature¶

arcgis.raster.functions.curvature(raster, curvature_type='standard', z_factor=1, astype=None)

The Curvature function displays the shape or curvature of the slope. A part of a surface can be concave or convex; you can tell that by looking at the curvature value. The curvature is calculated by computing the second derivative of the surface. Refer to this conceptual help on how it works.

http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/curvature-function.htm

Parameters
• raster – input raster

• curvature_type – ‘standard’, ‘planform’, ‘profile’

• z_factor – double

• astype – output pixel type

Returns

the output raster

## divide¶

arcgis.raster.functions.divide(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Divide operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## duration¶

arcgis.raster.functions.duration(rasters, min_value=None, max_value=None, undefined_class=None, astype=None)

Returns the duration (number of bands) between a minimum and maximum value. The Duration method finds the longest consecutive elements in the array, where each element has a value greater than or equal to min_value and less than or equal to max_value, and then returns its length.

Parameters
• rasters – the imagery layers filtered by where clause, spatial and temporal filters

• undefined_class – int, required

Returns

the output raster with this function applied to it

## elevation_void_fill¶

arcgis.raster.functions.elevation_void_fill(raster, max_void_width=0, astype=None)

The elevation_void_fill function is used to create pixels where holes exist in your elevation. Refer to <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/elevation-void-fill-function.htm”> this conceptual help</a> on how it works. The arguments for the elevation_void_fill function are as follows:

Parameters
• raster – input raster

• max_void_width – number. Maximum void width to fill. 0: fill all

• astype – output pixel type

Returns

the output raster

## equal_to¶

arcgis.raster.functions.equal_to(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The EqualTo operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## evi¶

arcgis.raster.functions.evi(raster, band_indexes='5 4 2', astype=None)

The Enhanced Vegetation Index (EVI) is an optimized vegetation index that accounts for atmospheric influences and vegetation background signal. It’s similar to NDVI, but is less sensitive to background and atmospheric noise, and it does not become saturated NDVI when viewing areas with very dense green vegetation.

EVI = 2.5 * [(NIR - Red)/(NIR + (6*Red) - (7.5*Blue) + 1)]

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR Red Blue”, e.g., “5 4 2” or [5,4,2]

• astype – output pixel type

Returns

output raster

## exp¶

arcgis.raster.functions.exp(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Exp operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## exp10¶

arcgis.raster.functions.exp10(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Exp10 operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## exp2¶

arcgis.raster.functions.exp2(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Exp2 operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## expression¶

arcgis.raster.functions.expression(raster, expression='(B3 - B1 / B3 + B1)', astype=None)

Use a single-line algebraic formula to create a single-band output. The supported operators are -, +, /, *, and unary -. To identify the bands, prepend the band number with a B or b. For example: “BandIndexes”:”(B1 + B2) / (B3 * B5)”

Parameters
• raster – the input raster / imagery layer

• expression – the algebric formula

• astype – output pixel type

Returns

output raster

Returns

## extract_band¶

arcgis.raster.functions.extract_band(raster, band_ids=None, band_names=None, band_wavelengths=None, missing_band_action=None, wavelength_match_tolerance=None, astype=None)

The extract_band function allows you to extract one or more bands from a raster, or it can reorder the bands in a multiband image. The arguments for the extract_band function are as follows:

Parameters
• raster – input raster

• band_ids – array of int, band_ids uses one-based indexing.

• band_names – array of string

• band_wavelengths – array of double

• missing_band_action – int, 0 = esriMissingBandActionFindBestMatch, 1 = esriMissingBandActionFail

• wavelength_match_tolerance – double

• astype – output pixel type

Returns

the output raster

## ferrous_minerals¶

arcgis.raster.functions.ferrous_minerals(raster, band_indexes='6 5', astype=None)

The Ferrous Minerals (FM) ratio is a geological index for identifying rock features containing some quantity of iron-bearing minerals using the shortwave infrared (SWIR) and near-infrared (NIR) bands. FM is used in mineral composite mapping.

FM = SWIR / NIR

Parameters
• raster – the input raster / imagery layer

• band_indexes – “SWIR NIR”, e.g., “6 5” or [6,5]

• astype – output pixel type

Returns

output raster

## FLOAT¶

arcgis.raster.functions.FLOAT(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Float operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## float_divide¶

arcgis.raster.functions.float_divide(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The FloatDivide operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## floor_divide¶

arcgis.raster.functions.floor_divide(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The FloorDivide operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## focal_stats¶

arcgis.raster.functions.focal_stats(raster, neighborhood_type=1, width=3, height=3, inner_radius=1, outer_radius=3, radius=3, start_angle=0, end_angle=90, neighborhood_values=None, stat_type=3, percentile_value=90, ignore_no_data=True)

Calculates for each input cell location a statistic of the values within a specified neighborhood around it. For more information see, https://pro.arcgis.com/en/pro-app/help/data/imagery/focal-statistics-function.htm

Parameters
• raster – input raster

• neighborhood_type – int, default is 1. The shape of the area around each cell used to calculate the statistic. 1 = Rectangle 2 = Circle 3 = Annulus 4 = Wedge 5 = Irregular 6 = Weight

• width – int, default is 3. Specified when neighborhood_type is Rectangle

• height – int, default is 3. Specified when neighborhood_type is Rectangle

• inner_radius – int, default is 1. Specified when neighborhood_type is Annulus

• outer_radius – int, default is 3. Specified when neighborhood_type is Annulus

• radius – int, default is 3. Specified when neighborhood_type is Circle or Wedge

• start_angle – float, default is 0. Specified when neighborhood_type is Wedge

• end_angle – float, default is 90. Specified when neighborhood_type is Wedge

• neighborhood_values – Specified when neighborhood_type is Irregular or Weight. It can be a list of lists, in which the width and height will be automatically set from the columns and rows of the two dimensional list, respectively. Alternatively, it can be a one dimensional list obtained from flattening a two dimensional list. In this case, the dimensions need to be specified explicitly with the width and height parameters.

• stat_type

int, default is 3(Mean)

There are 11 types of statistics available: 1=Majority, 2=Maximum, 3=Mean , 4=Median, 5= Minimum, 6 = Minority, 7=Range, 8=Standard deviation, 9=Sum, 10=Variety, 12=Percentile

Majority = Calculates the majority (value that occurs most often) of the cells in the neighborhood.

Maximum = Calculates the maximum (largest value) of the cells in the neighborhood.

Mean = Calculates the mean (average value) of the cells in the neighborhood.

Median = Calculates the median of the cells in the neighborhood.

Minimum = Calculates the minimum (smallest value) of the cells in the neighborhood.

Minority = Calculates the minority (value that occurs least often) of the cells in the neighborhood.

Range = Calculates the range (difference between largest and smallest value) of the cells in the neighborhood.

Standard deviation = Calculates the standard deviation of the cells in the neighborhood.

Sum = Calculates the sum (total of all values) of the cells in the neighborhood.

Variety = Calculates the variety (the number of unique values) of the cells in the neighborhood.

Percentile = Calculates a specified percentile of the cells in the neighborhood.

• ignore_no_data

boolean, default is True.

True - Specifies that if a NoData value exists within a neighborhood, the NoData value will be ignored. Only cells within the neighborhood that have data values will be used in determining the output value. This is the default.

False - Specifies that if any cell in a neighborhood has a value of NoData, the output for the processing cell will be NoData.

• percentile_value – float, default is 90. Denotes which percentile to calculate when the stat_type is Percentile. The value can range from 0 to 100.

Returns

the output raster

Note

The focal_stats() function is different from the focal_statistics() function in the following aspects:

The focal_stats() function supports Mean, Majority, Maximum, Median, Minimum, Minority, Percentile, Range, Standard deviation, Sum, and Variety. The focal_statistics() function supports only Minimum, Maximum, Mean, and Standard Deviation.

The focal_stats() function supports Rectangle, Circle, Annulus, Wedge, Irregular, and Weight neighborhoods. The focal_statistics() function supports only Rectangle.

The option to determine whether NoData values are ignored or not is available in the focal_stats() function by setting a bool value for ignore_no_data param. This option is not present in the focal_statistics() function.

The option to determine if NoData pixels are to be processed out is available in the focal_statistics() function by setting a bool value for fill_no_data_only param. This option is not present in the focal_stats() function.

## gemi¶

arcgis.raster.functions.gemi(raster, band_indexes='4 3', astype=None)

Global Environmental Monitoring Index GEMI = eta*(1-0.25*eta)-((Red-0.125)/(1-Red)) where eta = (2*(NIR^2-Red^2)+1.5*NIR+0.5*Red)/(NIR+Red+0.5)

Parameters

raster – the input raster / imagery layer

:param band_indexes:”NIR Red”, e.g., “4 3” or [4,3] :param astype: output pixel type :return: output raster

## generate_trend¶

arcgis.raster.functions.generate_trend(raster, dimension_name, regression_type=0, cycle_length=1, cycle_unit='YEARS', harmonic_frequency=1, polynomial_order=2, ignore_nodata=True, rmse=True, r2=False, slope_p_value=False)

Estimates the trend for each pixel along a dimension for one or more variables in a multidimensional raster.

Parameters
• raster – The input multidimensional raster.

• dimension_name – Required String. The dimension along which a trend will be extracted for the variable or variables selected in the analysis.

• regression_type

Optional Integer or String. Specifies the type of line to be used to fit to the pixel values along a dimension.

• 0 (LINEAR) : Fits the pixel values for a variable along a linear trend line. This is the default.

• 1 (HARMONIC) : Fits the pixel values for a variable along a harmonic trend line.

• 2 (POLYNOMIAL) : Fits the pixel values for a variable along a second-order polynomial trend line.

• cycle_length – Optional Integer. The length of periodic variation to model. This parameter is required when Trend Line Type is set to Harmonic. For example, leaf greenness often has one strong cycle of variation in a single year, so the cycle length is 1 year. Hourly temperature data has one strong cycle of variation throughout a single day, so the cycle length is 1 day. Default is 1.

• cycle_unit – Optional String. Specifies the time unit to be used for the length of harmonic cycle. Options: “DAYS”, “YEARS” (This is the default).

• harmonic_frequency – Optional Integer. The frequency number to use in the trend fitting. This parameter specifies the frequency of cycles in a year. The default value is 1, or one harmonic cycle per year. This parameter is only included in the trend analysis for a harmonic regression (regression_type=1).

• polynomial_order – Optional Integer. The polynomial order number to use in the trend fitting. This parameter specifies the polynomial order. The default value is 2, or second-order polynomial. This parameter is only included in the trend analysis for a polynomial regression (regression_type=2).

• ignore_nodata

Optional Boolean. Specifies whether NoData values are ignored in the analysis.

• True : The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default.

• False : The analysis will result in NoData if there are any NoData values for the pixels along the given dimension.

• rmse

Optional Boolean. Specifies whether to generate the root mean square error (RMSE) of the trend fit line.

• True : The RMSE will be calculated and displayed when the tool is finished running. This is the default.

• False : The RMSE will not be calculated.

• r2

Optional Boolean. Specifies whether to calculate the R-squared goodness-of-fit statistic for the trend fit line.

• True : The R-squared will be calculated and displayed when the tool is finished running.

• False : The R-squared will not be calculated. This is the default.

• slope_p_value

Optional Boolean. Specifies whether to calculate the p-value statistic for the slope coefficient of the trend line.

• True : The p-value will be calculated and displayed when the tool is finished running.

• False : The p-value will not be calculated. This is the default.

Returns

output raster

## geometric¶

arcgis.raster.functions.geometric(raster, geodata_transforms=None, append_geodata_xform=None, z_factor=None, z_offset=None, constant_z=None, correct_geoid=None, astype=None)

The geometric function transforms the image (for example, orthorectification) based on a sensor definition and a terrain model.This function was added at 10.1.The arguments for the geometric function are as follows:

Parameters
• raster – input raster

• geodata_transforms – Please refer to the Geodata Transformations documentation for more details.

• append_geodata_xform – boolean

• z_factor – double

• z_offset – double

• constant_z – double

• correct_geoid – boolean

• astype – output pixel type

Returns

the output raster

## gndvi¶

arcgis.raster.functions.gndvi(raster, band_indexes='4 2', astype=None)

Green Normalized Difference Vegetation Index

GNDVI = (NIR-Green)/(NIR+Green)

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR Green”, e.g., “5 3” or [5,3]

• astype – output pixel type

Returns

output raster

## grayscale¶

arcgis.raster.functions.grayscale(raster, conversion_parameters=None)

The Grayscale function converts a multi-band image into a single-band grayscale image. Specified weights are applied to each of the input bands, and a normalization is applied for output. For more information, see http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/grayscale-function.htm

Parameters
• raster – the input raster

• conversion_parameters – array of double (A length of N array representing weights for each band, where N=band count.)

Returns

the output raster with this function applied to it

## greater_than¶

arcgis.raster.functions.greater_than(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The GreaterThan operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## greater_than_equal¶

arcgis.raster.functions.greater_than_equal(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The GreaterThanEqual operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## gvitm¶

arcgis.raster.functions.gvitm(raster, band_indexes='1 2 3 4 5 6', astype=None)

Green Vegetation Index - Landsat TM GVITM = -0.2848*Band1-0.2435*Band2-0.5436*Band3+0.7243*Band4+0.0840*Band5-0.1800*Band7

Parameters

raster – the input raster / imagery layer

:param band_indexes:”NIR Red”, e.g., “4 3” or [4,3] :param astype: output pixel type :return: output raster

arcgis.raster.functions.hillshade(dem, azimuth=215.0, altitude=75.0, z_factor=0.3, slope_type=1, ps_power=None, psz_factor=None, remove_edge_effect=None, astype=None, hillshade_type=0)

Parameters
• dem – input DEM

• azimuth – double (e.g. 215.0)

• altitude – double (e.g. 75.0)

• z_factor – double (e.g. 0.3)

• slope_type – new at 10.2. 1=DEGREE, 2=PERCENTRISE, 3=SCALED. default is 1.

• ps_power – new at 10.2. double, used together with SCALED slope type

• psz_factor – new at 10.2. double, used together with SCALED slope type

• remove_edge_effect – new at 10.2. boolean, true of false

• astype – output pixel type

• hillshade_type – new at 10.5.1 0 = traditional, 1 = multi - directional; default is 0

Returns

the output raster

## identity¶

arcgis.raster.functions.identity(raster)

” The function is used to define the source raster as part of the default mosaicking behavior of the mosaic dataset. This function is a no-op function and takes no arguments except a raster. For more information, see (http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/identity-function.htm)

Parameters

raster – the input raster / imagery layer

Returns

the innput raster

## INT¶

arcgis.raster.functions.INT(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Int operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## interpolate_irregular_data¶

arcgis.raster.functions.interpolate_irregular_data(point_feature, value_field=None, cell_size=0, interpolation_method=0, radius=3, gis=None)

Interpolates from point clouds or irregular grids. (Supported from 10.8.1)

 Argument Description point_feature_class Rquired. The input point feature layer. value_field Optional string. The name of the field that contains the value of the points to be interpolated. cell_size Optional int. The cell size for the output raster dataset. interpolation_method Optional int or string. The resampling method to use for interpolation: 0 or NEAREST_NEIGBOR : Calculates pixel value using the nearest pixel. If no source pixel exists, no new pixel can be created in the output. This is the default. 2 or LINEAR_TINNING : Uses a triangular irregular network from the center points of each cell in the irregular raster to interpolate a surface that is then converted to a regular raster. 3 or NATURAL_NEIGHBOR : Finds the closest subset of input samples to a query point and applies weights to them based on proportionate areas to interpolate a value. 4 or INVERSE_DISTANCE_WEIGHTED : Determines cell values using a linearly weighted combination of a set of sample points or cells. The weight is a function of the inverse of the distance from the known points or cells. radius Optional int. The number of pixels to be included for resampling. The default value is 3 pixels. gis Optional gis. gis parameter can be specified to render the output raster dynamically using the raster rendering service of the gis. If not provided, active gis will be used to do this. If gis parameter is not specified the output of interpolate_irregular_data() cannot be displayed.
Returns

output raster with function applied

## iron_oxide¶

arcgis.raster.functions.iron_oxide(raster, band_indexes='4 2', astype=None)

The Iron Oxide (IO) ratio is a geological index for identifying rock features that have experienced oxidation of iron-bearing sulfides using the red and blue bands. IO is useful in identifying iron oxide features below vegetation canopies, and is used in mineral composite mapping.

IronOxide = Red / Blue

Parameters
• raster – the input raster / imagery layer

• band_indexes – “Red Blue”, e.g., “4 2” or [4,2]

• astype – output pixel type

Returns

output raster

## is_null¶

arcgis.raster.functions.is_null(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The IsNull operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## less_than¶

arcgis.raster.functions.less_than(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The LessThan operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## less_than_equal¶

arcgis.raster.functions.less_than_equal(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The LessThanEqual operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## linear_spectral_unmixing¶

arcgis.raster.functions.linear_spectral_unmixing(raster, spectral_profile_def=None, non_negative=False, sum_to_one=False)

Performs subpixel classification and calculates the fractional abundance of different land cover types for individual pixels.

Parameters
• raster – The input raster.

• spectral_profile_def – Optional dict. The class spectral profile information.

• non_negative

Optional bool. Specifies the options to define the output pixel values.

• True : There will be no negative output values.

• False : There can be negative values of fractional land cover. This is the default.

• sum_to_one

Optional bool. Specifies the options to define the output pixel values.

• True : Class values for each pixel are provided in decimal format with the sum of all classes equal to 1.

Example:

Class1 = 0.16; Class2 = 0.24; Class3 = 0.60.

• False : The sum of all classes in a pixel can exceed 1. This is the default.

Returns

output raster

## ln¶

arcgis.raster.functions.ln(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Ln operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## local¶

arcgis.raster.functions.local(rasters, operation, extent_type='FirstOf', cellsize_type='FirstOf', astype=None, process_as_multiband=None)

The local function allows you to perform bitwise, conditional, logical, mathematical, and statistical operations on a pixel-by-pixel basis. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/local-function.htm”>local function</a>.

ArcGIS Image Server to use this resource. At versions prior to 10.5, the hosting ArcGIS Server needs to have a Spatial Analyst license.

The arguments for the local function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• operation – int see reference at http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//004000000149000000

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

• process_as_multiband – True or False, set to True to process as multiband. Applicable for operations - Majority, Maximum, Mean, Median, Minimum, Minority, Range, Standard Deviation, Sum, and Variety.

Returns

the output raster

## log10¶

arcgis.raster.functions.log10(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Log10 operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## log2¶

arcgis.raster.functions.log2(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Log2 operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## lookup¶

arcgis.raster.functions.lookup(raster, field=None)

Creates a new raster by looking up values found in another field in the table of the input raster. For more information see, https://pro.arcgis.com/en/pro-app/help/data/imagery/lookup-function.htm

Parameters
• raster – The input raster that contains a field from which to create a new raster.

• field – Field containing the desired values for the new raster.

Returns

the output raster with this function applied to it

## majority¶

arcgis.raster.functions.majority(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Majority operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• ignore_nodata – True or False, set to True to ignore NoData values

• astype – output pixel type

• process_as_multiband – Set to True to process as multiband.

Returns

the output raster

arcgis.raster.functions.mask(raster, no_data_values=None, included_ranges=None, no_data_interpretation=None, astype=None)

The mask function changes the image by specifying a certain pixel value or a range of pixel values as no data. The arguments for the mask function are as follows:

Parameters
• raster – input raster

• no_data_values

list of strings [“band0_val”,”band1_val”,…]. The NoData values can be specified for each band. The index of each element in no_data_values list represents the no data value in the corresponding band.

You can specify more than one value by entering a space-delimited string for each index. e.g., [“band0_val1 band0_val2”, “band1_val1 band1_val2”,…]

• included_ranges – list of floats [band0_lowerbound,band0_upperbound,band1_lowerbound,band1_upperbound, band2_…..], The included ranges can be specified for each band by specifying a minimum and maximum value.

• no_data_interpretation

int 0=MatchAny, 1=MatchAll. This parameter refers to how the NoData values will impact the output image.

• 0 (MatchAny) : If the NoData value you specify occurs for a cell in a specified band, then that cell in the output image will be NoData.

• 1 (MatchAll) : The NoData values you specify for each band must occur in the same cell for the output image to contain the NoData cell.

• astype – output pixel type

Returns

the output raster

## max¶

arcgis.raster.functions.max(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Max operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

• process_as_multiband – Set to True to process as multiband.

Returns

the output raster

## mean¶

arcgis.raster.functions.mean(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Mean operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• ignore_nodata – True or False, set to True to ignore NoData values

• astype – output pixel type

• process_as_multiband – Set to True to process as multiband.

Returns

the output raster

## med¶

arcgis.raster.functions.med(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Med operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• ignore_nodata – True or False, set to True to ignore NoData values

• astype – output pixel type

• process_as_multiband – Set to True to process as multiband.

Returns

the output raster

## min¶

arcgis.raster.functions.min(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Min operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• ignore_nodata – True or False, set to True to ignore NoData values

• astype – output pixel type

• process_as_multiband – Set to True to process as multiband.

Returns

the output raster

## minority¶

arcgis.raster.functions.minority(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Minority operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• ignore_nodata – True or False, set to True to ignore NoData values

• astype – output pixel type

• process_as_multiband – True or False, set to True to process as multiband.

Returns

the output raster

## minus¶

arcgis.raster.functions.minus(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The binary Minus (subtraction,-) operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## ml_classify¶

arcgis.raster.functions.ml_classify(raster, signature, astype=None)
The ml_classify function allows you to perform a supervised classification using the maximum likelihood classification

algorithm. The hosting ArcGIS Server needs to have a Spatial Analyst license.LicenseLicense:At 10.5, you must license your ArcGIS Server as ArcGIS Server 10.5.1 Enterprise Advanced or ArcGIS Image Server to use this resource. At versions prior to 10.5, the hosting ArcGIS Server needs to have a Spatial Analyst license. The arguments for the ml_classify function are as follows:

Parameters
• raster – input raster

• signature – string. a signature string returned from computeClassStatistics (GSG)

• astype – output pixel type

Returns

the output raster

## mod¶

arcgis.raster.functions.mod(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Mod operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## monitor_vegetation¶

arcgis.raster.functions.monitor_vegetation(raster, method='NDVI', band_indexes=None, astype=None)

The monitor_vegetation function performs an arithmetic operation on the bands of a performs an arithmetic operation on the bands of a multiband raster layer to reveal vegetation coverage information of the study area. see Band Arithmetic function at http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/band-arithmetic-function.htm

Parameters
• raster – the input raster / imagery layer

• method – String. The method to create the vegetation index layer. The different vegetation indexes can help highlight certain features or reduce various noise. NDVI, SAVI, TSAVI, MSAVI, GEMI, PVI, GVITM, Sultan, VARI, GNDVI, SR, NDVIre, SRre, MTVI2, RTVICore, CIre, CIg, NDWI, EVI Default is NDVI.

• band_indexes – band indexes

• astype – output pixel type

Returns

output raster

## msavi¶

arcgis.raster.functions.msavi(raster, band_indexes='4 3', astype=None)

Modified Soil Adjusted Vegetation Index MSAVI2 = (1/2)*(2(NIR+1)-sqrt((2*NIR+1)^2-8(NIR-Red)))

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR Red”, e.g., “4 3” or [4,3]

• astype – output pixel type

Returns

output raster

## mtvi2¶

arcgis.raster.functions.mtvi2(raster, band_indexes='7 5 3', astype=None)

The Modified Triangular Vegetation Index (MTVI2) is a vegetation index for detecting leaf chlorophyll content at the canopy scale while being relatively insensitive to leaf area index. It uses reflectance in the green, red, and near-infrared (NIR) bands

MTVI2 = (1.5*(1.2*(NIR-Green)-2.5*(Red-Green))/sqrt((2*NIR+1)^2-(6*NIR-5*sqrt(Red))-0.5))

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR Red Green”, e.g., “7 5 3” or [7,5,3]

• astype – output pixel type

Returns

output raster

## multidimensional_filter¶

arcgis.raster.functions.multidimensional_filter(raster, variables=None, dimension_definition='ALL', dimension=None, dimension_ranges=None, dimension_values=None, start_of_first_iteration=None, end_of_first_iteration=None, iteration_step=3, iteration_unit=None, dimensionless=False)

Applies a filter on a multidimensional raster. Function creates a raster layer from a multidimensional raster by slicing data along defined variables and dimensions.

Parameters
• raster – The input multidimensional raster

• variables – Optional List. The list of variables that will be included in the output multidimensional raster layer. If no variable is specified, the first variable will be used.

• dimension_definition

Optional String. Specifies the method that will be used to slice the dimension.

• ALL : The full range for each dimension will be used. This is the default.

• BY_RANGES : The dimension will be sliced using a range or a list of ranges.

• BY_ITERATION : The dimension will be sliced over a specified interval.

• BY_VALUES : The dimension will be sliced using a list of dimension values.

• dimension – Optional String. The dimension along which the variables will be sliced. This parameter is required when the dimension_definition is set to BY_ITERATION.

• dimension_ranges

Optional list of dicts. This slices the data based on the dimension name and the minimum and maximum values for the range. This parameter is required when the dimension_definition is set to BY_RANGE. If dimension is StdTime, then the min value and max value must be specified in human readable time format (YYYY-MM-DDTHH:MM:SS). The input should be specified as: [{“dimension”:”<dimension_name>”, “minValue”:”<dimension_min_value>”, “maxValue”:”<dimension_max_value>”},{“dimension”:”<dimension_name>”, “minValue”:”<dimension_min_value>”, “maxValue”:”<dimension_max_value>”}]

Example:

[{“dimension”:”StdTime”, “minValue”:”2013-05-17T00:00:00”, “maxValue”:”2013-05-17T03:00:00”},{“dimension”:”StdZ”, “minValue”:”-5000”, “maxValue”:”-4000”}]

• dimension_values

Optional List of Dicts. This slices the data based on the dimension name and the value specified. This parameter is required when the dimension_definition is set to BY_VALUE.

If dimension is StdTime, then the value must be specified in human readable time format (YYYY-MM-DDTHH:MM:SS). The input should be specified as: [{“dimension”:”<dimension_name>”, “value”:”<dimension_value>”},{“dimension”:”<dimension_name>”, “value”:”<dimension_value>”}]

Example:

[{“dimension”:”StdTime”, “value”:”2012-01-15T03:00:00”},{“dimension”:” StdZ “, “value”:”-4000”}]

• start_of_first_iteration – Optional String. The beginning of the interval. This parameter is required when the dimension_definition is set to BY_ITERATION

• end_of_first_iteration – Optional String. The end of the interval. This parameter is required when the dimension_definition is set to BY_ITERATION

• iteration_step – Optional Float. The frequency with which the data will be sliced. This parameter is required when the dimension_definition is set to BY_ITERATION The default is 3.

• iteration_unit

Optional String. Specifies the iteration unit. This parameter is required when the dimension_definition is set to BY_ITERATION and the dimension parameter is set to StdTime.

• HOURS - Uses hours as the specified unit of time.

• DAYS - Uses days as the specified unit of time.

• WEEKS - Uses weeks as the specified unit of time.

• MONTHS - Uses months as the specified unit of time.

• YEARS -Uses years as the specified unit of time.

• dimensionless

Optional Boolean. Specifies whether the layer should have dimension values. This option is only available if a single slice is selected to create a layer.

• True - The layer will not have dimension values.

• False - The layer will have a dimension value. This is the default.

Returns

output raster

## ndvi¶

arcgis.raster.functions.ndvi(raster, band_indexes='4 3', astype=None)

Normalized Difference Vegetation Index NDVI = ((NIR - Red)/(NIR + Red))

Parameters
• raster – the input raster / imagery layer

• band_indexes – Band Indexes “NIR Red”, e.g., “4 3” or [4,3]

• astype – output pixel type

Returns

Normalized Difference Vegetation Index raster

## ndvire¶

arcgis.raster.functions.ndvire(raster, band_indexes='7 6', astype=None)

Red-Edge NDVI (NDVIre) The Red-Edge NDVI (NDVIre) is a vegetation index for estimating vegetation health using the red-edge band. It is especially useful for estimating crop health in the mid to late stages of growth where the chlorophyll concentration is relatively higher. Also, NDVIre can be used to map the within-field variability of nitrogen foliage to understand the fertilizer requirements of crops.

NDVIre = (NIR-RedEdge)/(NIR+RedEdge)

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR RedEdge”, e.g., “7 6” or [7,6]

• astype – output pixel type

Returns

output raster

## NDVI¶

arcgis.raster.functions.NDVI(raster, visible_band=2, ir_band=1, astype=None)

The Normalized Difference Vegetation Index (ndvi) is a standardized index that allows you to generate an image displaying greenness (relative biomass). This index takes advantage of the contrast of the characteristics of two bands from a multispectral raster dataset the chlorophyll pigment absorptions in the red band and the high reflectivity of plant materials in the near-infrared (NIR) band. For more information, see ndvi function. The arguments for the ndvi function are as follows:

Parameters
• raster – input raster

• visible_band_id – int (zero-based band id, e.g. 2)

• infrared_band_id – int (zero-based band id, e.g. 1)

• astype – output pixel type

Returns

the output raster

The following equation is used by the NDVI function to generate a 0 200 range 8 bit result: NDVI = ((IR - R)/(IR + R)) * 100 + 100 If you need the specific pixel values (-1.0 to 1.0), use the lowercase ndvi method.

## ndwi¶

arcgis.raster.functions.ndwi(raster, band_indexes='5 3', astype=None)

The Normalized Difference Water Index (NDWI) is an index for delineating and monitoring content changes in surface water. It is computed with the near-infrared (NIR) and green bands.

NDWI = (Green - NIR)/(Green +NIR)

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR Green”, e.g., “5 3” or [5,3]

• astype – output pixel type

Returns

output raster

## negate¶

arcgis.raster.functions.negate(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Negate operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## not_equal¶

arcgis.raster.functions.not_equal(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The NotEqual operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## pansharpen¶

arcgis.raster.functions.pansharpen(pan_raster, ms_raster, ir_raster=None, fourth_band_of_ms_is_ir=True, weights=[0.166, 0.167, 0.167, 0.5], type='ESRI', sensor=None)

The Pansharpening function uses a higher-resolution panchromatic raster to fuse with a lower-resolution, multiband raster. It can generate colorized multispectral image with higher resolution. For more information, see http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/pansharpening-function.htm

Parameters
• pan_raster – raster, which is panchromatic

• ms_raster – raster, which is multispectral

• ir_raster – Optional, if fourth_band_of_ms_is_ir is true or selected pansharpening method doesn’t require near-infrared image

• fourth_band_of_ms_is_ir – Boolean, “true” if “ms_raster” has near-infrared image on fourth band

• weights – Weights applied for Red, Green, Blue, Near-Infrared bands. 4-elements array, Sum of values is 1

• type – string, describes the Pansharpening method one of “IHS”, “Brovey” “ESRI”, “SimpleMean”, “Gram-Schmidt”. Default is “ESRI”

• sensor – string, it is an optional parameter to specify the sensor name

Returns

output raster with function applied

## plus¶

arcgis.raster.functions.plus(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## power¶

arcgis.raster.functions.power(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Power operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## predict_using_trend¶

arcgis.raster.functions.predict_using_trend(raster, dimension_definition_type=0, dimension_values=None, start=None, end=None, interval_value=1, interval_unit='HOURS')

Computes a forecasted multidimensional raster layer using the output trend raster from the generate_trend function.

Parameters
• raster – The input raster.

• dimension_definition_type

Optional Integer or String. Specifies the method used to provide prediction dimension values.

• 0 (BY_VALUE) : The prediction will be calculated for a single dimension value. For example, you want to predict yearly precipitation for the years 2050, 2100, and 2150. This is the default.

• 1 (BY_INTERVAL) : The prediction will be calculated for an interval of the dimension defined by a start and an end value. For example, you want to predict yearly precipitation for every year between 2050 and 2150.

• dimension_values – Optional List. The dimension value or values to be used in the prediction. The format of the time, depth, and height values must match the format of the dimension values used to generate the trend raster. If the trend raster was generated for the StdTime dimension, the format should be YYYY-MM-DDTHH:MM:SS, for example, 2050-01-01T00:00:00.

• start – Optional String or Integer. The start date, height, or depth of the dimension interval to be used in the prediction. This parameter is required when the dimension_definition_type parameter is set to 1 (By Interval).

• end – Optional String or Integer. The end date, height, or depth of the dimension interval to be used in the prediction. This parameter is required when the dimension_definition_type parameter is set to 1 (By Interval).

• interval_value – Optional Integer. The number of steps between two dimension values to be included in the prediction. The default value is 1. This parameter is required when the dimension_definition_type parameter is set to 1 (By Interval).

• interval_unit

Optional String. The unit that will be used for the value interval. This parameter only applies when the dimension of analysis is a time dimension.

• HOURS - The prediction will be calculated for each hour in the range of time described by the start, end, and interval_value parameters.

• DAYS - The prediction will be calculated for each day in the range of time described by the start, end, and interval_value parameters.

• WEEKS - The prediction will be calculated for each week in the range of time described by the start, end, and interval_value parameters.

• MONTHS - The prediction will be calculated for each month in the range of time described by the start, end, and interval_value parameters.

• YEARS - The prediction will be calculated for each year in the range of time described by the start, end, and interval_value parameters.

Returns

output raster

## pvi¶

arcgis.raster.functions.pvi(raster, band_indexes='4 3 0.3 0.5', astype=None)

Perpendicular Vegetation Index PVI = (NIR-a*Red-b)/(sqrt(1+a^2))

Parameters

raster – the input raster / imagery layer

:param band_indexes:”NIR Red a b”, e.g., “4 3 0.3 0.5” or [4,3,0.3,0.5] :param astype: output pixel type :return: output raster

## cellstats_range¶

arcgis.raster.functions.cellstats_range(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Range operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• ignore_nodata – True or False, set to True to ignore NoData values

• astype – output pixel type

• process_as_multiband – True or False, set to True to process as multiband.

Returns

the output raster

## random_raster¶

arcgis.raster.functions.random_raster(raster_info, distribution=1, min_uniform=0.0, max_uniform=1.0, min_integer=1, max_integer=10, normal_mean=0.0, std_dev=1.0, exp_mean=1.0, poisson_mean=1.0, alpha=1.0, beta=1.0, N=10, r=10, probability=0.5, seed=1, generator_type=2, gis=None)

Creates a virtual raster with random values for each cell.

Parameters
• raster_info

Required Raster info dictionary or ImageryLayer object to set the properties of the output raster. if ImageryLayer is specified then the raster information is obtained from the ImageryLayer specified.

Example for RasterInfo dict -

{‘bandCount’: 3,’extent’: {“xmin”: 4488761.95, “ymin”: 5478609.805, “xmax”: 4489727.05, “ymax”: 5479555.305, “spatialReference”: { “wkt”: “PROJCS[“Deutsches_Hauptdreiecksnetz_Transverse_Mercator”, GEOGCS[“GCS_Deutsches_Hauptdreiecksnetz”,DATUM[“D_Deutsches_Hauptdreiecksnetz”, SPHEROID[“Bessel_1841”,6377397.155,299.1528128]],PRIMEM[“Greenwich”,0.0], UNIT[“Degree”,0.0174532925199433]],PROJECTION[“Transverse_Mercator”], PARAMETER[“false_easting”,4500000.0],PARAMETER[“false_northing”,0.0], PARAMETER[“central_meridian”,12.0],PARAMETER[“scale_factor”,1.0], PARAMETER[“latitude_of_origin”,0.0],UNIT[“Meter”,1.0]]” }}, ‘pixelSizeX’: 0.0999999999999614, ‘pixelSizeY’: 0.1, ‘pixelType’: ‘U8’}

• distribution

Optional int. Specify the random value distribution method to use. Default 1. i,e; Uniform

Choice list:

Uniform = 1 UniformInteger = 2 Normal = 3 Exponential = 4 Poisson = 5 Gamma = 6 Binomial = 7 Geometric = 8 NegativeBinomial = 9

Uniform - A uniform distribution with the defined range.

UniformInteger - An integer distribution with the defined range.

Normal - A normal distribution with a defined {normal_mean} and {std_dev}.

Exponential - An exponential distribution with a defined {exp_mean}.

Poisson - A Poisson distribution with a defined {Mean}.

Gamma - A gamma distribution with a defined {alpha} and {beta}.

Binomial - A binomial distribution with a defined {N} and {probability}.

Geometric - A geometric distribution with a defined {probability}.

NegativeBinomial - A Pascal distribution with a defined {r} and {probability}.

• min_uniform – Optional float. The default value is 0.0

• max_uniform – Optional float. The default value is 1.0

• min_integer – Optional int. The default value is 1

• max_integer – Optional int. The default value is 10

• normal_mean – Optional float. The default value is 0.0

• std_dev – Optional float. The default value is 1.0

• exp_mean – Optional float. The default value is 1.0

• poisson_mean – Optional float. The default value is 1.0

• alpha – Optional float. The default value is 1.0

• beta – Optional float. The default value is 1.0

• N – Optional int. The default value is 0.0

• r – Optional int. The default value is 0.0

• probability – Optional float. The default value is 0.5

• seed – Optional int. The default value is 0.0

• generator_type – Optional int. Default 2. i.e; MersenneTwister Choice list: Standard C Rand = 0 ACM collected algorithm 599 = 1 MersenneTwister = 2

• gis – Optional gis. gis parameter can be specified to render the output raster dynamically using the raster rendering service of the gis. If not provided, active gis will be used to do this. If gis parameter is not specified the output of constant_raster() cannot be displayed.

Returns

output raster

## raster_calculator¶

arcgis.raster.functions.raster_calculator(rasters, input_names, expression, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The RasterCalculator function provides access to all existing math functions so you can make calls to them when building your expressions. The calculator function requires single-band inputs. If you need to perform expressions on bands in a multispectral image as part of a function chain, you can use the Extract Bands Function before the RasterCalculator function. For more info including operators supported, see Calculator function http://pro.arcgis.com/en/pro-app/help/data/imagery/calculator-function.htm

Parameters
• raster – array of rasters

• input_names – array of strings for arbitrary raster names.

• expression – string, expression to calculate output raster from input rasters

• extent_type – string, one of “FirstOf”, “IntersectionOf” “UnionOf”, “LastOf”. Default is “FirstOf”.

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf “MeanOf”, “LastOf”. Default is “FirstOf”.

• astype – output pixel type

Returns

output raster with function applied

## raster_collection_function¶

arcgis.raster.functions.raster_collection_function(raster, item_function=None, aggregation_function=None, processing_function=None, aggregation_definition_type='ALL', dimension=None, interval_keyword=None, interval_value=None, interval_unit=None, interval_ranges=None)

Creates a new raster by applying item, aggregation and processing function :param raster: Input Imagery Layer. The image service the layer is based on should be a mosaic dataset :param item_function: The raster function template to be applied on each item of the mosaic dataset.

Create an RFT object out of the raster function template item on the portal and specify that as the input to item_function

Parameters
• aggregation_function – The aggregation function to be applied on the mosaic dataset. Create an RFT object out of the raster function template item on the portal and specify that as the input to aggregation_function

• processing_function – The processing template to be applied on the imagery layer. Create an RFT object out of the raster function template item on the portal and specify that as the input to processing_function.

• aggregation_definition_type

Optional String. Specifies the dimension interval for which the data will be aggregated.

• ALL : The data values will be aggregated across all slices. This is the default.

• INTERVAL_KEYWORD : The variable data will be aggregated using a commonly known interval.

• INTERVAL_VALUE : The variable data will be aggregated using a user-specified interval and unit.

• INTERVAL_RANGES : The variable data will be aggregated between specified pairs of values or dates.

• dimension – Optional String. This is the dimension along which the variables will be aggregated.

• interval_keyword

Optional String. Specifies the keyword interval that will be used when aggregating along the dimension. This parameter is required when the aggregation_def parameter is set to INTERVAL_KEYWORD, and the aggregation must be across time.

• HOURLY : The data values will be aggregated into hourly time steps, and the result will include every hour in the time series.

• DAILY : The data values will be aggregated into daily time steps, and the result will include every day in the time series.

• WEEKLY : The data values will be aggregated into weekly time steps, and the result will include every week in the time series.

• DEKADLY : Divides each month into 3 periods of 10 days each (last period might have more or less than 10 days) and each month would output 3 slices.

• PENTADLY : Divides each month into 6 periods of 5 days each (last period might have more or less than 5 days) and each month would output 6 slices.

• MONTHLY : The data values will be aggregated into monthly time steps, and the result will include every month in the time series.

• QUARTERLY : The data values will be aggregated into quarterly time steps, and the result will include every quarter in the time series.

• YEARLY : The data values will be aggregated into yearly time steps, and the result will include every year in the time series.

• RECURRING_DAILY : The data values will be aggregated into daily time steps, and the result includes each one aggregated value per day. The output will include, at most, 366 daily time slices

• RECURRING_WEEKLY : The data values will be aggregated into weekly time steps, and the result will include one aggregated value per week. The output will include, at most, 53 weekly time slices.

• RECURRING_MONTHLY : The data values will be aggregated into weekly time steps, and the result will include one aggregated value per month. The output will include, at most, 12 monthly time slices.

• RECURRING_QUARTERLY : The data values will be aggregated into weekly time steps, and the result will include one aggregated value per quarter. The output will include, at most, 4 quarterly time slices.

• interval_value

Optional String. The size of the interval that will be used for the aggregation. This parameter is required when the aggregation_def parameter is set to INTERVAL_VALUE.

For example, to aggregate 30 years of monthly temperature data into 5-year increments, enter 5 as the interval_value, and specify interval_unit as YEARS.

• interval_unit

Optional String. The unit that will be used for the interval value. This parameter is required when the dimension parameter is set to a time field and the aggregation_def parameter is set to INTERVAL_VALUE.

If you are aggregating over anything other than time, this option will not be available and the unit for the interval value will match the variable unit of the input multidimensional raster data.

• HOURS : The data values will be aggregated into hourly time slices at the interval provided.

• DAYS : The data values will be aggregated into daily time slices at the interval provided.

• WEEKS : The data values will be aggregated into weekly time slices at the interval provided.

• MONTHS : The data values will be aggregated into monthly time slices at the interval provided.

• YEARS : The data values will be aggregated into yearly time slices at the interval provided.

• interval_ranges

Optional List of dictionary objects. Interval ranges specified as list of dictionary objects that will be used to aggregate groups of values.

This parameter is required when the aggregation_definition parameter is set to INTERVAL_RANGE. If dimension is StdTime, then the value must be specified in human readable time format (YYYY-MM-DDTHH:MM:SS).

Syntax:

[{“minValue”:”<min value>”,”maxValue”:”<max value>”}, {“minValue”:”<min value>”,”maxValue”:”<max value>”}]

Example:

[{“minValue”:”2012-01-15T03:00:00”,”maxValue”:”2012-01-15T09:00:00”}, {“minValue”:”2012-01-15T12:00:00”,”maxValue”:”2012-01-15T21:00:00”}]

Returns

the output raster with function applied on it

## remap¶

arcgis.raster.functions.remap(raster, input_ranges=None, output_values=None, geometry_type=None, geometries=None, no_data_ranges=None, allow_unmatched=None, astype=None)

The remap function allows you to change or reclassify the pixel values of the raster data. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/remap-function.htm”>remap function</a>.

The arguments for the remap function are as follows:

Parameters
• raster – input raster

• input_ranges – [double, double,…], input ranges are specified in pairs: from (inclusive) and to (exclusive).

• output_values – [double, …], output values of corresponding input ranges

• geometry_type – added at 10.3

• geometries – added at 10.3

• no_data_ranges – [double, double, …], nodata ranges are specified in pairs: from (inclusive) and to (exclusive).

• allow_unmatched – Boolean, specify whether to keep the unmatched values or turn into nodata.

• astype – output pixel type

Returns

the output raster

## resample¶

arcgis.raster.functions.resample(raster, resampling_type=None, input_cellsize=None, output_cellsize=None, astype=None)

The resample function resamples pixel values from a given resolution.The arguments for the resample function are as follows:

Parameters
• raster – input raster

• resampling_type – one of NearestNeighbor,Bilinear,Cubic,Majority,BilinearInterpolationPlus,BilinearGaussBlur, BilinearGaussBlurPlus, Average, Minimum, Maximum,VectorAverage(require two bands)

• input_cellsize – point that defines cellsize in source spatial reference

• output_cellsize – point that defines output cellsize

• astype – output pixel type

Returns

the output raster

## round_down¶

arcgis.raster.functions.round_down(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The RoundDown operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## round_up¶

arcgis.raster.functions.round_up(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The RoundUp operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## rtvi_core¶

arcgis.raster.functions.rtvi_core(raster, band_indexes='7 6 3', astype=None)

The Red-Edge Triangulated Vegetation Index (RTVICore) is a vegetation index for estimating leaf area index and biomass. This index uses reflectance in the NIR, red-edge, and green spectral bands

RTVICore = [100(NIR-RedEdge)-10(NIR-Green)]

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR RedEdge Green”, e.g., “7 6 3” or [7,6,3]

• astype – output pixel type

Returns

output raster

arcgis.raster.functions.s1_radiometric_calibration(raster, calibration_type=None)

Performs different types of radiometric calibration on Sentinel-1 data.

Parameters
• raster

The input raster. The Sentinel-1 Level-1 GRD or SLC input raster you want to process.

The function will use the LUT file either to apply the thermal correction or to remove the correction, depending on the contents of the LUT.

• calibration_type

Optional string or int. one of four calibration types: “beta_nought” (0) - produces an output containing the radar brightness coefficient. “sigma_nought” (1) - the backscatter returned to the antenna from a unit area on the ground, related to ground range. “gamma” (2) - measurement of emitted and returned energy useful for determining antenna patterns.

None - Specify None to not apply a correction. This is the default.

Returns

output raster

## s1_thermal_noise_removal¶

arcgis.raster.functions.s1_thermal_noise_removal(raster, calibration_type=None)

Removes thermal noise from Sentinel-1 data.

Parameters

raster

The input raster. The Sentinel-1 Level-1 GRD or SLC input raster you want to process.

The function will use the LUT file either to apply the thermal correction or to remove the correction, depending on the contents of the LUT.

Returns

output raster

## savi¶

arcgis.raster.functions.savi(raster, band_indexes='4 3 0.33', astype=None)

Soil-Adjusted Vegetation Index SAVI = ((NIR - Red) / (NIR + Red + L)) x (1 + L) where L represents amount of green vegetative cover, e.g., 0.5

Parameters
• raster – the input raster / imagery layer

• band_indexes – “BandIndexes”: “NIR Red L”, for example, “4 3 0.33” or [4,3,0.33]

• astype – output pixel type

Returns

output raster

## segment_mean_shift¶

arcgis.raster.functions.segment_mean_shift(raster, spectral_detail=None, spatial_detail=None, spectral_radius=None, spatial_radius=None, min_num_pixels_per_segment=None, astype=None)

The segment_mean_shift function produces a segmented output. Pixel values in the output image represent the converged RGB colors of the segment. The input raster needs to be a 3-band 8-bit image. If the imagery layer is not a 3-band 8-bit unsigned image, you can use the Stretch function before the segment_mean_shift function.

License:At 10.5, you must license your ArcGIS Server as ArcGIS Server 10.5.1 Enterprise Advanced or ArcGIS Image Server to use this resource. At versions prior to 10.5, the hosting ArcGIS Server needs to have a Spatial Analyst license.

When specifying arguments for SegmentMeanShift, use either SpectralDetail,SpatialDetail as a pair, or use SpectralRadius, SpatialRadius. They have an inverse relationship. SpectralRadius = 21 - SpectralDetail, SpatialRadius = 21 - SpectralRadius

The arguments for the segment_mean_shift function are as follows:

Parameters
• raster – input raster

• spectral_detail – double 0-21. Bigger value is faster and has more segments.

• spatial_detail – int 0-21. Bigger value is faster and has more segments.

• spectral_radius – double. Bigger value is slower and has less segments.

• spatial_radius – int. Bigger value is slower and has less segments.

• min_num_pixels_per_segment – int

• astype – output pixel type

Returns

the output raster

## set_null¶

arcgis.raster.functions.set_null(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The SetNull operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

arcgis.raster.functions.shaded_relief(raster, azimuth=None, altitude=None, z_factor=None, colormap=None, slope_type=None, ps_power=None, psz_factor=None, remove_edge_effect=None, astype=None, colorramp=None, hillshade_type=0)

The arguments for the shaded_relief function are as follows:

Parameters
• raster – input raster

• azimuth – double (e.g. 215.0)

• altitude – double (e.g. 75.0)

• z_factor – double (e.g. 0.3)

• colormap – [[<value1>, <red1>, <green1>, <blue1>], [<value2>, <red2>, <green2>, <blue2>]]

• slope_type – 1=DEGREE, 2=PERCENTRISE, 3=SCALED. default is 1.

• ps_power – double, used together with SCALED slope type

• psz_factor – double, used together with SCALED slope type

• remove_edge_effect – boolean, True or False

• astype – output pixel type

• colorramp – string, specifying color ramp name like <Black To White|Yellow To Red|Slope|more..> or a color ramp object. For more information about colorramp object, see color ramp object at http://resources.arcgis.com/en/help/arcgis-rest-api/#/Color_ramp_objects/02r3000001m0000000/)

• hillshade_type – new at 10.8.1. int, 0 = traditional, 1 = multi - directional; default is 0

Returns

the output raster

## sin¶

arcgis.raster.functions.sin(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Sin operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## sinh¶

arcgis.raster.functions.sinh(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The SinH operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## slope¶

arcgis.raster.functions.slope(dem, z_factor=None, slope_type=None, ps_power=None, psz_factor=None, remove_edge_effect=None, astype=None)

slope represents the rate of change of elevation for each pixel. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/slope-function.htm”>slope function</a> and <a href=”http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/how-slope-works.htm”>How slope works</a>. The arguments for the slope function are as follows:

Parameters
• dem – input DEM

• z_factor – double (e.g. 0.3)

• slope_type – new at 10.2. 1=DEGREE, 2=PERCENTRISE, 3=SCALED. default is 1.

• ps_power – new at 10.2. double, used together with SCALED slope type

• psz_factor – new at 10.2. double, used together with SCALED slope type

• remove_edge_effect – new at 10.2. boolean, true of false

• astype – output pixel type

Returns

the output raster

## spectral_conversion¶

arcgis.raster.functions.spectral_conversion(raster, conversion_matrix)

The SpectralConversion function applies a matrix to a multi-band image to affect the spectral values of the output. In the matrix, different weights can be assigned to all the input bands to calculate each of the output bands. The column/row size of the matrix equals to the band count of input raster. For more information, see Spectral Conversion function http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/spectral-conversion-function.htm

Parameters
• raster – the input raster

• conversion_parameters – array of double (A NxN length one-dimension matrix, where N=band count.)

Returns

the output raster with this function applied to it

## speckle¶

arcgis.raster.functions.speckle(raster, filter_type='Lee', filter_size='3x3', noise_model='Multiplicative', noise_var=None, additive_noise_mean=None, multiplicative_noise_mean=1, nlooks=1, damp_factor=None)

The Speckle function filters the speckled radar dataset to smooth out the noise while retaining the edges or sharp features in the image. Four speckle reduction filtering algorithms are provided through this function. For more information including required and optional parameters for each filter and the default parameter values, see Speckle function http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/speckle-function.htm

Parameters
• raster – input raster type

• filter_type – string, one of “Lee”, “EnhancedLee” “Frost”, “Kaun”. Default is “Lee”.

• filter_size – string, kernel size. One of “3x3”, “5x5”, “7x7”, “9x9”, “11x11”. Default is “3x3”.

• noise_model – string, For Lee filter only. One of “Multiplicative”, “Additive”, “AdditiveAndMultiplicative”

• noise_var – double, for Lee filter with noise_model “Additive” or “AdditiveAndMultiplicative”

• multiplicative_noise_mean – double, For Lee filter with noise_model “Additive” or “AdditiveAndMultiplicative”

• nlooks – int, for Lee, EnhancedLee and Kuan Filters

• damp_factor – double, for EnhancedLee and Frost filters

Returns

output raster with function applied

## sqrt¶

arcgis.raster.functions.sqrt(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Square Root operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## square¶

arcgis.raster.functions.square(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Square operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## sr¶

arcgis.raster.functions.sr(raster, band_indexes='4 3', astype=None)

Simple Ratio (SR)

SR = NIR / Red

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR Red”, e.g., “4 3” or [4,3]

• astype – output pixel type

Returns

output raster

## srre¶

arcgis.raster.functions.srre(raster, band_indexes='7 6', astype=None)

The Red-Edge Simple Ratio (SRre) is a vegetation index for estimating the amount of healthy and stressed vegetation. It is the ratio of light scattered in the NIR and red-edge bands, which reduces the effects of atmosphere and topography.

Values are high for vegetation with high canopy closure and healthy vegetation, lower for high canopy closure and stressed vegetation, and low for soil, water, and nonvegetated features. The range of values is from 0 to about 30, where healthy vegetation generally falls between values of 1 to 10.

SRre = NIR / RedEdge

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR RedEdge”, e.g., “7 6” or [7,6]

• astype – output pixel type

Returns

output raster

## focal_statistics¶

arcgis.raster.functions.focal_statistics(raster, kernel_columns=None, kernel_rows=None, stat_type=None, columns=None, rows=None, fill_no_data_only=None, astype=None)

The focal_statistics function calculates focal statistics for each pixel of an image based on a defined focal neighborhood. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/statistics-function.htm”>statistics function</a>. The arguments for the statistics function are as follows:

Parameters
• raster – input raster

• kernel_columns – int (e.g. 3)

• kernel_rows – int (e.g. 3)

• stat_type – int or string. There are four types of focal statistical functions: 1=Min, 2=Max, 3=Mean, 4=StandardDeviation -Min-Calculates the minimum value of the pixels within the neighborhood -Max-Calculates the maximum value of the pixels within the neighborhood -Mean-Calculates the average value of the pixels within the neighborhood. This is the default. -StandardDeviation-Calculates the standard deviation value of the pixels within the neighborhood

• columns – int (e.g. 3). The number of pixel rows to use in your focal neighborhood dimension.

• rows – int (e.g. 3). The number of pixel columns to use in your focal neighborhood dimension.

• fill_no_data_only – bool

• astype – output pixel type

Returns

the output raster

Note

The focal_statistics() function is different from the focal_stats() function in the following aspects:

The focal_statistics() function supports Minimum, Maximum, Mean, and Standard Deviation. The focal_stats() function supports Mean, Majority, Maximum, Median, Minimum, Minority, Range, Standard deviation, Sum, and Variety.

The focal_statistics() function supports only Rectangle. The focal_stats() function supports Rectangle, Circle, Annulus, Wedge, Irregular, and Weight neighborhoods.

The option to determine if NoData pixels are to be processed out is available in the focal_statistics() function by setting a bool value for fill_no_data_only param. This option is not present in the focal_stats() function.

The option to determine whether NoData values are ignored or not is available in the focal_stats() function by setting a bool value for ignore_no_data param. This option is not present in the focal_statistics() function.

## statistics_histogram¶

arcgis.raster.functions.statistics_histogram(raster, statistics=None, histograms=None)

” The function is used to define the statistics and histogram of a raster. It is normally used for control the default display of exported image. For more information, see Statistics and Histogram function, http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/statistics-and-histogram-function.htm

Parameters
• raster – the input raster / imagery layer

• statistics – array of statistics objects. (Predefined statistics for each band)

• histograms – array of histogram objects. (Predefined histograms for each band)

Returns

Statistics and Histogram defined raster

## std¶

arcgis.raster.functions.std(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Std operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• ignore_nodata – True or False, set to True to ignore NoData values

• astype – output pixel type

• process_as_multiband – True or False, set to True to process as multiband.

Returns

the output raster

## stretch¶

arcgis.raster.functions.stretch(raster, stretch_type=0, min=None, max=None, num_stddev=None, statistics=None, dra=None, min_percent=None, max_percent=None, gamma=None, compute_gamma=None, sigmoid_strength_level=None, astype=None)

The stretch function enhances an image through multiple stretch types. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/stretch-function.htm”>stretch function</a>.

Gamma stretch works with all stretch types. The Gamma parameter is needed when UseGamma is set to true. Min and Max can be used to define output minimum and maximum. DRA is used to get statistics from the extent in the export_image request. ComputeGamma will automatically calculate best gamma value to render exported image based on empirical model.

Stretch type None does not require other parameters. Stretch type StdDev requires NumberOfStandardDeviations, Statistics, or DRA (true). Stretch type Histogram (Histogram Equalization) requires the source dataset to have histograms or additional DRA (true). Stretch type MinMax requires Statistics or DRA (true). Stretch type PercentClip requires MinPercent, MaxPercent, and DRA (true), or histograms from the source dataset. Stretch type Sigmoid does not require other parameters.

Optionally, set the SigmoidStrengthLevel (1 to 6) to adjust the curvature of Sigmoid curve used in color stretch.

The arguments for the stretch function are as follows:

Parameters
• raster – input raster

• stretch_type – str, one of None, StdDev, Histogram, MinMax, PercentClip, 9 = Sigmoid

• min – double

• max – double

• num_stddev – double (e.g. 2.5)

• statistics – double (e.g. 2.5)[<min1>, <max1>, <mean1>, <standardDeviation1>], //[double, double, double, double][<min2>, <max2>, <mean2>, <standardDeviation2>]],

• dra – boolean. derive statistics from current request, Statistics parameter is ignored when DRA is true

• min_percent – double (e.g. 0.25), applicable to PercentClip

• max_percent – double (e.g. 0.5), applicable to PercentClip

• gamma – array of doubles

• compute_gamma – optional, applicable to any stretch type when “UseGamma” is “true”

• sigmoid_strength_level – int (1~6), applicable to Sigmoid

• astype – output pixel type

Returns

the output raster

## sultan¶

arcgis.raster.functions.sultan(raster, band_indexes='1 2 3 4 5 6', astype=None)
Sultan’s Formula (transform to 3 band 8 bit image)

Band 1 = (Band5 / Band6) x 100 Band 2 = (Band5 / Band1) x 100 Band 3 = (Band3 / Band4) x (Band5 / Band4) x 100

Parameters

raster – the input raster / imagery layer

:param band_indexes:”Band1 Band2 Band3 Band4 Band5 Band6”, e.g., “1 2 3 4 5 6” or [1,2,3,4,5,6] :param astype: output pixel type :return: output raster

## sum¶

arcgis.raster.functions.sum(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Sum operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• ignore_nodata – True or False, set to True to ignore NoData values

• astype – output pixel type

• process_as_multiband – True or False, set to True to process as multiband.

Returns

the output raster

## tan¶

arcgis.raster.functions.tan(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Tan operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## tanh¶

arcgis.raster.functions.tanh(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The TanH operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## tasseled_cap¶

arcgis.raster.functions.tasseled_cap(raster)

” The function is designed to analyze and map vegetation and urban development changes detected by various satellite sensor systems. It is known as the Tasseled Cap transformation due to the shape of the graphical distribution of data. This function takes no arguments except a raster. The input for this function is the source raster of image service. There are no other parameters for this function because all the information is derived from the input’s properties and key metadata (bands, data type, and sensor name). Only imagery from the Landsat MSS, Landsat TM, Landsat ETM+, IKONOS, QuickBird, WorldView-2 and RapidEye sensors are supported. Prior to applying this function, there should not be any functions that would alter the pixel values in the function chain, such as the Stretch, Apparent Reflectance or Pansharpening function. The only exception is for Landsat ETM+; when using Landsat ETM+, the Apparent Reflectance function must precede the Tasseled Cap function. For more information, see http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/tasseled-cap-transformation.htm

Parameters

raster – the input raster / imagery layer

Returns

the output raster with TasseledCap function applied to it

## threshold¶

arcgis.raster.functions.threshold(raster, astype=None)
The binary threshold function produces the binary image. It uses the Otsu method and assumes the input image to have

a bi-modal histogram. The arguments for the threshold function are as follows:

Parameters
• raster – input raster

• astype – output pixel type

Returns

the output raster

## times¶

arcgis.raster.functions.times(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)

The Times (multiplication,*) operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• astype – output pixel type

Returns

the output raster

## transpose_bits¶

arcgis.raster.functions.transpose_bits(raster, input_bit_positions=None, output_bit_positions=None, constant_fill_check=None, constant_fill_value=None, fill_raster=None, astype=None)

The transpose_bits function performs a bit operation. It extracts bit values from the source data and assigns them to new bits in the output data.The arguments for the transpose_bits function are as follows:

If constant_fill_check is False, it assumes there is an input fill_raster. If an input fill_raster is not given, it falls back constant_fill_check to True and looks for constant_fill_value. Filling is used to initialize pixel values of the output raster. Landsat 8 has a quality assessment band. The following are the example input and output bit positions to extract confidence levels by mapping them to 0-3: * Landsat 8 Water: {“input_bit_positions”:[4,5],”output_bit_positions”:[0,1]} * Landsat 8 Cloud Shadow: {“input_bit_positions”:[6,7],”output_bit_positions”:[0,1]} * Landsat 8 Vegetation: {“input_bit_positions”:[8,9],”output_bit_positions”:[0,1]} * Landsat 8 Snow/Ice: {“input_bit_positions”:[10,11],”output_bit_positions”:[0,1]} * Landsat 8 Cirrus: {“input_bit_positions”:[12,13],”output_bit_positions”:[0,1]} * Landsat 8 Cloud: {“input_bit_positions”:[14,15],”output_bit_positions”:[0,1]} * Landsat 8 Designated Fill: {“input_bit_positions”:[0],”output_bit_positions”:[0]} * Landsat 8 Dropped Frame: {“input_bit_positions”:[1],”output_bit_positions”:[0]} * Landsat 8 Terrain Occlusion: {“input_bit_positions”:[2],”output_bit_positions”:[0]}

Parameters
• raster – input raster

• input_bit_positions – array of long, required

• output_bit_positions – array of long, required

• constant_fill_check – bool, optional

• constant_fill_value – int, required

• fill_raster – optional, the fill raster

• astype – output pixel type

Returns

the output raster

## tsavi¶

arcgis.raster.functions.tsavi(raster, band_indexes='4 3 0.33 0.50 1.50', astype=None)

Transformed Soil Adjusted Vegetation Index TSAVI = (s(NIR-s*Red-a))/(a*NIR+Red-a*s+X*(1+s^2))

Parameters
• raster – the input raster / imagery layer

• band_indexes – “NIR Red s a X”, e.g., “4 3 0.33 0.50 1.50” or [4,3,0.33,0.50,1.50] where a = the soil line intercept, s = the soil line slope, X = an adjustment factor that is set to minimize soil noise

• astype – output pixel type

Returns

output raster

## unit_conversion¶

arcgis.raster.functions.unit_conversion(raster, from_unit=None, to_unit=None, astype=None)

The unit_conversion function performs unit conversions.The arguments for the unit_conversion function are as follows: from_unit and to_unit take the following str values: Speed Units: MetersPerSecond, KilometersPerHour, Knots, FeetPerSecond, MilesPerHour Temperature Units: Celsius,Fahrenheit,Kelvin Distance Units: str, one of Inches, Feet, Yards, Miles, NauticalMiles, Millimeters, Centimeters, Meters

Parameters
• raster – input raster

• from_unit – units constant listed below (int)

• to_unit – units constant listed below (int)

• astype – output pixel type

Returns

the output raster

## vari¶

arcgis.raster.functions.vari(raster, band_indexes='3 2 1', astype=None)

Visible Atmospherically Resistant Index

VARI = (Green - Red)/(Green + Red - Blue)

Parameters
• raster – the input raster / imagery layer

• band_indexes – “Red Green Blue”, e.g., “3 2 1” or [3,2,1]

• astype – output pixel type

Returns

output raster

## variety¶

arcgis.raster.functions.variety(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None, process_as_multiband=None)

The Variety operation

The arguments for this function are as follows:

Parameters
• rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string

• extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”

• cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”

• ignore_nodata – True or False, set to True to ignore NoData values

• astype – output pixel type

• process_as_multiband – True or False, set to True to process as multiband.

Returns

the output raster

## vector_field¶

arcgis.raster.functions.vector_field(raster_u_mag, raster_v_dir, input_data_type='Vector-UV', angle_reference_system='Geographic', output_data_type='Vector-UV', astype=None)

The VectorField function is used to composite two single-band rasters (each raster represents U/V or Magnitude/Direction) into a two-band raster (each band represents U/V or Magnitude/Direction). Data combination type (U-V or Magnitude-Direction) can also be converted interchangeably with this function. For more information, see Vector Field function (http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/vector-field-function.htm)

Parameters
• raster_u_mag – raster item representing ‘U’ or ‘Magnitude’ - imagery layers filtered by where clause, spatial and temporal filters

• raster_v_dir – raster item representing ‘V’ or ‘Direction’ - imagery layers filtered by where clause, spatial and temporal filters

• input_data_type – string, ‘Vector-UV’ or ‘Vector-MagDir’ per input used in ‘raster_u_mag’ and ‘raster_v_dir’

• angle_reference_system – string, optional when ‘input_data_type’ is ‘Vector-UV’, one of “Geographic”, “Arithmetic”

• output_data_type – string, ‘Vector-UV’ or ‘Vector-MagDir’

Returns

the output raster with this function applied to it

## vector_field_renderer¶

arcgis.raster.functions.vector_field_renderer(raster, is_uv_components=None, reference_system=None, mass_flow_angle_representation=None, calculation_method='Vector Average', symbology_name='Single Arrow', astype=None)

The vector_field_renderer function symbolizes a U-V or Magnitude-Direction raster.The arguments for the vector_field_renderer function are as follows:

Parameters
• raster – input raster

• is_uv_components – bool

• reference_system – int 1=Arithmetic, 2=Angular

• mass_flow_angle_representation – int 0=from 1=to

• calculation_method – string, “Vector Average” |

• symbology_name – string, “Single Arrow” |

• astype – output pixel type

Returns

the output raster

## weighted_overlay¶

arcgis.raster.functions.weighted_overlay(rasters, fields, influences, remaps, eval_from, eval_to)
The WeightedOverlay function allows you to overlay several rasters using a common

measurement scale and weights each according to its importance. For more information, see

http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/weighted-overlay-function.htm

Parameters
• raster – array of rasters

• fields – array of string fields of the input rasters to be used for weighting.

• influences – array of double, Each input raster is weighted according to its importance, or its influence. The sum of the influence weights must equal 1

• remaps

array of strings, Each value in an input raster is assigned a new value based on the

remap. The remap value can be a valid value or a NoData value.

param eval_from

required, numeric value of evaluation scale from

param eval_to

required, numeric value of evaluation scale to

Returns

output raster with function applied

## weighted_sum¶

arcgis.raster.functions.weighted_sum(rasters, fields, weights)
The WeightedSum function allows you to overlay several rasters, multiplying each by their