How Cell Statistics works

Available with Spatial Analyst license.

Available with Image Analyst license.

For the Cell statistics tool, the value of each location on the output raster is calculated as a function of the cell values from all of the inputs at that location. Some details and examples of each statistic are provided below.

Mean

  • Determines the average value of the inputs on a cell-by-cell basis.
  • The output for Mean is always floating point.
  • Example:
    Cell Statistics—Mean example
    OutRas = CellStatistics(["InRas1", "InRas2", "InRas3"], "Mean", "NODATA")

Majority

  • Determines the value that occurs most frequently in the inputs on a cell-by-cell basis.
  • If all the inputs are integer, the output is integer. If any of the inputs are floating point, the output is floating point.
  • When there is more than one majority value for a cell location, the output for that location is NoData.
  • If all input values for a cell location are the same, the output majority value for that location is the same as the input.
  • A reasonable application should consist of at least three inputs. If only a single input is specified, the output will be a duplicate of the input.
  • If there are only two inputs, any location where the values are different will be written as NoData. Since there are only two different values from which to choose, there is no majority value. If the values are the same, that value will be written to the output raster.
Cell Statistics—Majority example
OutRas = CellStatistics([InRas1, InRas2, InRas3], "Majority", "NODATA")

Maximum

  • Determines the largest value of the inputs on a cell-by-cell basis.
  • If all the inputs are integer, the output is integer. If any of the inputs are floating point, the output is floating point.
Cell Statistics—Maximum example
OutRas = CellStatistics(["InRas1", "InRas2", "InRas3"], "Maximum", "NODATA")

Median

  • Determines the median value of the inputs on a cell-by-cell basis.
  • If the number of inputs is odd, the median value is calculated by ranking the values and selecting the middle value. If the number of inputs is even, the values will be ranked, and the middle two values will be averaged. This value will be truncated to an integer if all the input grids are of integer type.
  • If all the inputs are integer, the output is integer. If any of the inputs are floating point, the output is floating point.
Cell Statistics—Median example
OutRas = CellStatistics([InRas1, InRas2, InRas3], "Median", "NODATA")

Minimum

  • Determines the smallest value of the inputs on a cell-by-cell basis.
  • If all the inputs are integer, the output is integer. If any of the inputs are floating point, the output is floating point.
Cell Statistics—Minimum example
OutRas = CellStatistics(["InRas1", "InRas2", "InRas3"], "Minimum", "NODATA")

Minority

  • Determines the value that occurs least frequently in the inputs on a cell-by-cell basis.
  • When there is more than one minority value for a cell location, the output for that location is NoData.
  • If all input values for a cell location are the same, the output minority value for that location is the same as the input.
  • A reasonable application should consist of at least three inputs. If only a single input is specified, the output will be a duplicate of the input.
  • If there are only two inputs, any location where the values are different will be written as NoData. Since there are only two different values from which to choose, there is no minority value. If the values are the same, that value will be written to the output raster.
  • If all the inputs are integer, the output is integer. If any of the inputs are floating point, the output is floating point.
Cell Statistics—Minority example
OutRas = CellStatistics([InRas1, InRas2, InRas3], "Minority", "NODATA")

Range

  • Determines the range of values in the inputs on a cell-by-cell basis.
  • If all the inputs are integer, the output is integer. If any of the inputs are floating point, the output is floating point.
Cell Statistics—Range example
OutRas = CellStatistics([InRas1, InRas2, InRas3], "Range", "NODATA")

Std

  • Determines the standard deviation of the values in the inputs on a cell-by-cell basis.
  • The output for Std is always floating point.
  • Note that the standard deviation is calculated on the entire population (the N method); it is not estimated based on a sample (the N-1 method).
Cell Statistics—Standard Deviation example
OutRas = CellStatistics([InRas1, InRas2, InRas3], "STD", "NODATA")

Sum

  • Determines the sum of the values in the inputs on a cell-by-cell basis.
  • If all the inputs are integer, the output is integer. If any of the inputs are floating point, the output is floating point.
Cell Statistics—Sum example
OutRas = CellStatistics([InRas1, InRas2, InRas3], "Sum", "NODATA")

Variety

  • Determines the number of unique values in the inputs on a cell-by-cell basis.
  • The output raster is always of integer type.
Cell Statistics—Variety example
OutRas = CellStatistics([InRas1, InRas2, InRas3], "Variety", "NODATA")

Related topics