Raster statistics (Environment setting)

Tools that honor the Raster Statistics environment control how statistics are built for output raster datasets.

The Statistics option enables you to build statistics for the output raster dataset. Statistics are required for the raster dataset to perform certain tasks in ArcMap or ArcCatalog, such as applying a contrast stretch or classifying data. It is not essential to build statistics, since they are calculated the first time they are needed, if they have not already been calculated. It is, however, recommended that you calculate statistics before using the raster dataset if certain features that require statistics are to be used.

Usage notes

Dialog syntax

Scripting syntax

arcpy.env.rasterStatistics = "calculate_statistics {x_skip_factor} {y_skip_factor} {statistics_ignore_value}"

Parameters

Explanation

calculate_statistics (Required)

To calculate statistics, use STATISTICS; otherwise, specify NONE.

x_skip_factor (Optional)

The skip factor for the X axis.

y_skip_factor (Optional)

The skip factor for the Y axis.

statistics_ignore_value (Optional)

One or more ignore values, such as a background value, that will not participate in the statistics calculation. Multiple values are separated by a space.

rasterStatistics syntax
import arcpy

# Statistics using a skip factor of 100 for x and y, and 
# ignore values of 0 and 255.
arcpy.env.rasterStatistics = 'STATISTICS 100 100 (0 255)'

Related Topics

3/3/2014