Home
About Isis
Support
Download

Isis 3

Documentation
Tutorials
Technical Documents

Isis 2

Documentation
Tutorials
Technical Documents

Search

USGS

Isis 3 Application Documentation


stats

Printer Friendly View | TOC | Home

Generates statistics about a cube

Overview Parameters Example 1 Example 2 Example 3

Description

This program computes statistics for the pixels in each band of a multiple band cube. if the band specification (e.g., file.cub+3) is not given the program will default to all bands. The statistics calculated include:
        Average
        Standard deviation
        Variance
        Median
        Mode
        Skew
        Minimum
        Maximum
        Total pixels
        Valid pixels
        Null pixels
        Low instrument saturation pixels
        Low representation saturation pixels
        High instrument saturation pixels
        High representation saturation pixels
The statistics will be output to the logging device. Additionally, if the user specifies a file using the TO parameter, the statistics be written to the file in a standard label format which can then be read using the getkey proram.

Categories


Related Applications in Previous Versions of Isis

This application replaces the following applications existing in previous versions of Isis, which have been deprecated from the current version of Isis:
  • average
  • avg_sd
  • bandstats

History

Jeff Anderson2002-06-17 Original version written as "histo"
Stuart Sides2002-07-24 Changed name to "stats" and added logging mechanism
Jeff Anderson2002-12-30 Added TO parameter which allows the user to create an output file that can be read using the getkey program
Jeff Anderson2002-12-30 Tested for bands which contain only special pixels in order to prevent divide by zero errors.
Jeff Anderson2002-12-31 Added the name of the input cube to the log and label file
Kim Sides2003-05-13 Added application test
Stuart Sides2003-05-16 Modified schema location from astogeology... to isis.astrogeology..."
Stuart Sides2003-05-30 Made changes to application test truth files to reflect -O1 optimization
Stuart Sides2003-05-30 Added modifications to apptest by Kim
Stuart Sides2003-07-29 Modified filename parameters to be cube parameters where necessary
Stuart Sides2003-11-07 Modified results pvl to not include the results group
Jacob Danton2006-01-23 Fixed appTest to comply to changes in iString
Steven Lambright2008-05-06 Added Above Range, Below Range reports
Steven Lambright2008-05-13 Removed references to CubeInfo
Steven Lambright2008-08-15 A bug where the VALIDMIN,VALIDMAX were ignored was fixed; these should always be used.
Stacy Alley2009-01-16 Added the Format option for the output file.
Sharmila Prasad2011-03-31 Added Band Keyword - displays the first physical band used to get the stats
James Alexander Crough2011-06-17 Changed the behavior of the program to process all bands of a cube, or, if an input cube attribute is specified, only those bands will be processed. Previously, the program only processed the first band.

Parameter Groups

Files

Name Description
FROM Single band of a cube to get statistics from
TO Output file to contain statistics
FORMAT Output Format
APPEND Append Output to File

Settings

Name Description
VALIDMIN Minimum DN valid to count as valid
VALIDMAX Maximum DN valid to count as valid
X

Files: FROM


Description

The file specification for the input cube. The statistics will be calculated for one band only. The default band is one but can be overridden using the band specifier (e.g., file.cub+3).

Type cube
File Mode input
Filter *.cub
Close Window
X

Files: TO


Description

This ascii file will contain the statistics of the individual band. It is written in such a format that the values can be read using the getkey program. This is useful for when developing scripts. In order to generate an output file, an output filename must be included. To specify format, use the format parameter.

Type filename
File Mode output
Internal Default No Output file will be created
Filter *.txt
Close Window
X

Files: FORMAT


Description

Format type for output file. PVL format is default.

Type string
Default PVL
Option List:
Option Brief Description
PVL Format the output file as PVL. Output file will be in PVL format.
FLAT Firnat the output file as comma delimited flat. Output file will be a comma deliminated flatfile. This file format can easily be imported into excel. The format is ignored unless the TO parameter is specified.
Close Window
X

Files: APPEND


Description

If this option is selected, the output from the application will be appended to the file. If it is not selected, any information in the TO file will be overwritten.

Type boolean
Default TRUE
Close Window
X

Settings: VALIDMIN


Description

The statistics will exclude any DN values below this value

Type double
Internal Default No minimum DN value
Close Window
X

Settings: VALIDMAX


Description

The statistics will exclude any DN values above this value

Type double
Internal Default No maximum DN value
Close Window

Example 1

Calculating statistics for all bands in a cube

Description

This example shows the statistics gathered from all bands in a single cube. When no band is specified by the user, stats default behavior is to calculate stats for all bands of a cube.

Command Line

stats from=peaks.cub to=peaks0_stats.log
Running stats in the command line mode with the only parameter "FROM" set to no particular band of the cube peaks.cub.

Data File

Links open in a new window.
Output from stats This is the output captured in "peaks0_stats.log" by the redirection of standard out.

Example 2

Calculating statistics for a band in a cube

Description

This example shows the statistics gathered from a single band of a cube. Using the plus on the end of the FROM parameter, a user is able to specify a single layer to be processed.

Command Line

stats from=peaks.cub+3 to=peaks1_stats.log
Running stats in the command line mode with the only parameter "FROM" set to the third band of the cube peaks.cub.

Data File

Links open in a new window.
Output from stats This is the output captured in "peaks3_stats.log" by the redirection of standard out.

Example 3

Calculating statistics for multiple bands in a cube

Description

This example shows the statistics gathered from a multiple bands of a cube. In addition to the plus suffix, one can use commas and hyphens in order to specify multiple bands of the cube to process.

Command Line

stats from=peaks.cub+2,4-6 to=peaks2_stats.log
Running stats in the command line mode with the only parameter "FROM" set to the second, forth, fifth, and sixth bands of the cube peaks.cub.

Data File

Links open in a new window.
Output from stats This is the output captured in "peaks2_stats.log" by the redirection of standard out.