Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Raster toolset > Tools

Calculate Statistics (Data Management)

Release 9.2
Last modified November 29, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Calculates statistics for a raster dataset.

Statistics are required for your raster dataset to perform certain tasks, such as applying a contrast stretch or classifying your data.


Usage tips

Command line syntax
An overview of the Command Line window
CalculateStatistics_management <in_raster_dataset> {x_skip_factor} {y_skip_factor} {ignore_values;ignore_values...}

Parameter Explanation Data Type
<in_raster_dataset>

The input raster dataset.

Composite Geodataset
{x_skip_factor}

The number of horizontal pixels between samples.

The value must be greater than zero and less than or equal to the number of columns in the raster dataset. The default is one or the last skip factor used.

The skip factors for raster datasets stored in a file geodatabase or an ArcSDE geodatabase are different. First, if the x and the y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, then the number is rounded down to the next pyramid level and those statistics are used.

Long
{y_skip_factor}

The number of vertical pixels between samples.

The value must be greater than zero and less than or equal to the number of rows in the raster. The default is one or the last y skip factor used.

For raster datasets in a file or ArcSDE geodatabase, if the skip values are not equal, then the smaller number is used. If skip factor is not equal to a pyramid level, then the value will be rounded down to match a pyramid level.

Long
{ignore_values;ignore_values...}

The pixel values that are not to be included in the statistics calculation. The default is no value or the last ignore values used.

Long
Data types for geoprocessing tool parameters


Command line example

CalculateStatistics_management D:\images\OverviewImage.img 2 2 999

Scripting syntax
About getting started with writing geoprocessing scripts
CalculateStatistics_management (in_raster_dataset, x_skip_factor, y_skip_factor, ignore_values)

Parameter Explanation Data Type
in_raster_dataset (Required)

The input raster dataset.

Composite Geodataset
x_skip_factor (Optional)

The number of horizontal pixels between samples.

The value must be greater than zero and less than or equal to the number of columns in the raster dataset. The default is one or the last skip factor used.

The skip factors for raster datasets stored in a file geodatabase or an ArcSDE geodatabase are different. First, if the x and the y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, then the number is rounded down to the next pyramid level and those statistics are used.

Long
y_skip_factor (Optional)

The number of vertical pixels between samples.

The value must be greater than zero and less than or equal to the number of rows in the raster. The default is one or the last y skip factor used.

For raster datasets in a file or ArcSDE geodatabase, if the skip values are not equal, then the smaller number is used. If skip factor is not equal to a pyramid level, then the value will be rounded down to match a pyramid level.

Long
ignore_values (Optional)

The pixel values that are not to be included in the statistics calculation. The default is no value or the last ignore values used.

Long

Data types for geoprocessing tool parameters


Script example

# Create the geoprocessing object
import arcgisscripting
gp = arcgisscripting.create()

gp.workspace = "c:/redlands_data"

# Calculate stats with skip factor of 1,1, and ignore value of 0
gp.CalculateStatistics_management("redlands1.tif","1","1","0")

Map Algebra syntax
See BuildSta.

ArcObjects syntax
There is no corresponding ArcGIS Spatial Analyst object to perform calculate statistics for a raster. However, in core ArcGIS, similar functionality can be found in the IRasterStatistics.Recalculate method.
For more information, see ArcObjects Developer Help.

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.