Skip to main content
  • Home
  • Documentation
  • FAQ
  • Downloads
  • Support
  • Current Release Notes
  • Ferret Users Guide
    • Users Guide Index
    • Commands Reference
    • 1. Introduction
    • 2. Data Set Basics
    • 3. Variables & Expressions
    • 4. Grids & Regions
    • 5. Animations & Gif Images
    • 6. Customizing Plots
    • 7. Handling String Data Symbols
    • 8. Working with Special Data Sets
    • 9. Computing Environment
    • 10. Converting to NetCDF
    • 11. Writing External Functions
    • Glossary
    • Appendix A: Functions
    • Appendix B: PPLUS Guide
    • Appendix C: Ferret-Specific PPLUS Enhancements
  • Previous Release Notes
  • Tutorials and Demos
    • Ferret Tour
    • DSG files: Discrete Sampling Geometries Demo
    • Ferret sorting demo
    • Fast Fourier Transforms demo
    • Empirical Orthogonal Functions demo
    • Ferret objective analysis demo
    • Ferret Palette Demo
    • Map projections
    • Ferret polygon vector demo
    • Ferret Graticules demo
    • Ferret Polytube Demo
    • Ferret Polymark Demo
    • Ferret Constant-Array demo
    • Ferret land_detail demo
    • COADS Tour
    • Levitus Tour
    • Use OPeNDAP
    • Ferret binary read demo
  • PyFerret
    • PyFerret Downloads and Install ../../faq/ferret-faqs.html
    • What is PyFerret?
    • Why use PyFerret?
    • PyFerret for the Ferret user
    • PyFerret command syntax: quick-start notes
    • PyFerret for the Python user
    • Graphics in PyFerret ?
    • New Ferret functionality
    • PyFerret Python functions and constants
    • PyFerret Python objects and methods
    • Ferret external functions in Python
    • Ferret Fortran external functions
    • PyFerret metadata-and-data dictionaries
  • OPeNDAP
    • OPeNDAP usage in Ferret
    • Use OPeNDAP Demo
    • Test OPeNDAP

STATISTICS

Ref Sec35.

STATISTICS

/I/J/K/L/M/N X/Y/Z/T/E/F /D /BRIEF /PRECISION

Computes summary statistics about the data specified.

yes? STATISTICS[/qualifiers] expression_1 , expression_2 , ...

The statistics include:

  • the size and shape of the region
  • total number of data values in the region specified
  • number of data values flagged as bad data
  • minimum value
  • maximum value
  • mean value (arithmetic mean‚ not weighted by grid spacing)
  • standard deviation (also not weighted by grid spacing)

All values are reported to 5 significant digits by default, see STAT/PRECISION below.

STATISTICS interacts with the current context exactly as the commands CONTOUR, PLOT and LIST do.

 

Parameters

Expressions may be anything described under Expressions. If multiple variables or expressions are specified they are treated in sequence. The expression(s) are inferred from the current context if omitted from the command line.

Command qualifiers for STATISTICS:

STATISTICS/I=/J=/K=/L=/M=/N=/X=/Y=/Z=/T=/E=/F=
Specifies value or range of axis subscripts (I, J, K, L, M, or N), or axis coordinates (X, Y, Z, T, E, or F) to be used when computing statistics about the expression(s).

STATISTICS/D=
Specifies the default data set to be used when computing statistics about the expression(s).

STATISTICS/BRIEF
Produces a shorter listing involving less computation.
 

STATISTICS/PRECISION=
Lists the results with the stated precision, 1 through 16.

 

When the STAT command runs, ferret automatically defines a set of Symbols which can be used in scripts: STAT_MIN, STAT_MAX, STAT_MEAN, STAT_STD, STAT_NGOOD, STAT_NBAD.

Example:

 

 

yes? USE coads_climatology   
yes? STAT sst
SEA SURFACE TEMPERATURE
LONGITUDE: 20E to 20E(380)
LATITUDE: 90S to 90N
Z:  N/A
TIME: 01-JAN 00:45 to 31-DEC 06:34
DATA SET: /home/fer_dsets/data/coads_climatology.cdf
Total # of data points: 194400 (180*90*1*12)
# flagged as bad  data: 89622
Minimum value: -2.6
Maximum value: 33.15
Mean    value: 18.095 (unweighted average)
Standard deviation: 9.4023
 
yes? SHOW SYMBOL stat*
STAT_MIN = "-2.6"
STAT_MAX = "33.15"
STAT_MEAN = "18.095"
STAT_STD = "9.4023"
STAT_NGOOD = "104778"
STAT_NBAD = "89622"