ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Band Collection Statistics

Available with Spatial Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Calculates the statistics for a set of raster bands.

Learn more about how Band Collection Statistics works

Usage

  • The raster bands must have a common intersection. If there are none, an error occurs and no output is created.

  • If the extents of the raster bands are not the same, the statistics will be calculated on the common spatial extent of all the input raster bands. The cell size will be that of the maximum of the input rasters, by default; otherwise, it will depend on the Raster Analysis environment settings.

  • For the Compute covariance and correlation matrices parameter, the default unchecked setting (BRIEF in scripting) indicates that only the minimum, maximum, mean, and standard deviation of the input raster bands will be computed. To calculate the covariance and correlation matrices in addition to these statistics, check this option on in the tool dialog box (or use DETAILED in scripting).

    A covariance matrix presents the variances of all raster bands along the diagonal from the upper left to lower right and covariances between all raster bands in the remaining entries. The correlation matrix provides the correlation coefficients between each combination of two input bands.

  • In the calculation of the covariance matrix, the mean value of the band is used for any input cells that are NoData.

  • The statistics are written to the output file in ASCII text format. The extension for the output must be .txt.

  • If the input is a layer created from a multiband raster with more than three bands, the operation will consider all the bands associated with the source dataset, not just the three bands that were loaded (symbolized) by the layer.

  • There are several ways you can specify a subset of bands from a multiband raster to use as input into the tool.

    • If using the tool dialog box, browse to the multiband raster using the browse Browse button next to Input raster bands, open the raster, and select the desired bands.
    • If the multiband raster is a layer in the Table of Contents, you can use the Make Raster Layer tool to create a new multiband layer containing only the desired bands.
    • You can also create a new dataset that contains only the desired bands with Composite Bands and use the resulting dataset as input to the tool.
    • In Python, the desired bands can be directly specified in the tool parameter as a list.

Syntax

BandCollectionStats (in_raster_bands, out_stat_file, {compute_matrices})
ParameterExplanationData Type
in_raster_bands
[in_raster_band,...]

The input raster bands.

They can be integer or floating point type.

Raster Layer
out_stat_file

The output ASCII file containing the statistics.

A .txt extension is required.

File
compute_matrices
(Optional)

Specifies whether covariance and correlation matrices are calculated.

  • BRIEF — Only the basic statistical measures (minimum, maximum, mean, and standard deviation) will be calculated for every layer. This is the default.
  • DETAILED — In addition to the standard statistics calculated with {BRIEF}, the covariance and correlation matrices will also be determined.
Boolean

Code Sample

BandCollectionStatistics example 1 (Python window)

This example calculates the statistics for a set of raster bands.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
BandCollectionStats("redlands", "c:/sapyexamples/output/redbandstats.txt", "BRIEF")
BandCollectionStatistics example 2 (stand-alone script)

This example calculates the statistics for a set of raster bands.

# Name: BandCollectionStats_Ex_02.py
# Description: Calculates the statistics for a set of raster bands.
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inRasterBand1 = "sb/sbc1"
inRasterBand2 = "sb/sbc2"
outStatFile = "C:/sapyexamples/output/bandstatfile.txt"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.checkOutExtension("Spatial")

# Execute BandCollectionStats
BandCollectionStats([inRasterBand1, inRasterBand2], outStatFile, "DETAILED")

Environments

  • Current Workspace
  • Scratch Workspace

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst

Related Topics

  • An overview of the Multivariate toolset
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal