- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑
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.
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.
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:
-
There is a routine for each of the standard numeric types. Replace "
x"
in the routine name by D, R, I,
W, UW, B or UB as appropriate. The data type of the array being analysed must match the particular
routine used.
-
If no clipping is performed (i.e. if NCLIP = 0) then the values of arguments which return results after
clipping will be the same as for those returning results before clipping.
-
If ISTAT(1) or ISTATC(1) is zero, then the values of all the derived statistics will be undefined and will
be set to the "
bad"
value appropriate to their data type (except for the pixel sum, which will be
zero).
References
Terriberry, T.B., 2007, Computing Higher-order Moments Online,
http://people.xiph.org/tterribe/notes/homs.html.
- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑