KPG_OSTAx

Computes simple statistics for an array

Description:

This routine computes simple statistics for an array, namely: the number of valid pixels; the minimum and maximum pixel values (and their positions); the pixel sum; the mean; and the population standard deviation, skewness, and excess kurtosis. Iterative K-sigma clipping may also be optionally applied.

It uses a one-pass recursive algorithm for efficiency using the formulae of Terriberry (2007).

Invocation

CALL KPG_OSTAx( BAD, EL, DATA, NCLIP, CLIP, ISTAT, DSTAT, ISTATC, DSTATC, STATUS )

Arguments

BAD = LOGICAL (Given)
Whether checks for bad pixels should be performed on the array being analysed.
EL = INTEGER (Given)
Number of pixels in the array.
DATA( EL ) = ? (Given)
Array to be analysed.
NCLIP = INTEGER (Given)
Number of K-sigma clipping iterations to apply (may be zero).
CLIP( NCLIP ) = REAL (Given)
Array of clipping limits for successive iterations, expressed as standard deviations.
ISTAT( 3 ) = INTEGER (Returned)
The integer statistics before clipping. The meanings of the elements in order are as follows.
  • Number of valid pixels

  • Index where the pixel with the lowest value was (first) found

  • Index where the pixel with the highest value was (first) found

DSTAT( 7 ) = DOUBLE PRECISION (Returned)
The floating-point statistics before clipping derived from the valid pixel values in DATA. The meanings of the elements in order are as follows.
  • Minimum value

  • Maximum value

  • Sum

  • Mean

  • Population standard deviation

  • Population skewness

  • Population excess kurtosis. This is zero for a Gaussian.

ISTATC( 3 ) = INTEGER (Returned)
The integer statistics after clipping derived from the valid pixel values in DATA. The attributions of the elements are the same as for argument ISTAT. If NCLIP is zero, the array will contain the same values as ISTAT.
DSTATC( 7 ) = DOUBLE PRECISION (Returned)
The floating-point statistics after clipping derived from the valid pixel values in DATA. The attributions of the elements are the same as for argument DSTAT. If NCLIP is zero, the array will contain the same values as DSTAT.
STATUS = INTEGER (Given and Returned)
The global status.

Notes:

References

Terriberry, T.B., 2007, Computing Higher-order Moments Online, http://people.xiph.org/ tterribe/notes/homs.html.