# Focal Statistics function

Available with Spatial Analyst license.

## Overview

Calculates statistics on the cells within a neighborhood around each cell of an input raster. Several shapes of neighborhood are available.

## Notes

If the input raster is of floating-point type, only the Mean, Maximum, Minimum, Range, Standard deviation, and Sum statistics are available.

When a circular, annulus-shaped, or wedge-shaped neighborhood is specified, some of the outer diagonal cells may not be considered in the calculations since the center of the cell must be encompassed within the neighborhood.

Input NoData cells may receive a value in the output if the Ignore NoData in calculations option is checked, provided at least one cell within the neighborhood has a valid value

## Parameters

Parameter nameDescription

Raster

(Required)

The input raster.

Statistics Type

The statistic type to be calculated.

• Mean—Calculates the mean (average value) of the cells in the neighborhood.
• 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.
• 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.

If the input raster is floating point, only the Mean, Maximum, Minimum, Range, Standard Deviation, and Sum statistic types are available.

The default statistic type is Mean.

Neighborhood

The shape of the area around each cell used to calculate the statistic.

Each neighborhood have additional parameters with which to define the shape.

• Rectangle, Width, Height
• Wedge, Radius, Start angle, End angle
• Irregular, Width, Height, Neighborhood values
• Weight, Width, Height, Neighborhood values

The Irregular neighborhood allows you to specify an irregularly shaped neighborhood around the processing cell. Use the Neighborhood values table to define the shape of the neighborhood kernel. A value of 0 for a cell position indicates that the cell is not part of the neighborhood, and will not be used for processing. A value of 1 indicates that its corresponding cell (and value) is a member of the neighborhood.

The Weight neighborhood is similar to the irregular neighborhood type, in that it allows you to define an irregular neighborhood around the processing cell, but it additionally allows you to apply weights to the input values. The values in the weight kernel specifies which cell positions should be included within the neighborhood and the weights by which they will be multiplied. Use a value of 0 to exclude a cell from processing. Positive, negative, and decimal values are all valid options to use as a weight.

##### Note:

For the Weight neighborhood type, only the Mean, Standard Deviation, or Sum statistics are supported.

Ignore NoData in calculations

Denotes whether NoData values are ignored by the statistic calculation.

• Checked—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.
• Unchecked—Specifies that if any cell in a neighborhood has a value of NoData, the output for the processing cell will be NoData