KPG1_HSTAx

Computes simple ordered statistics for an array via an histogram

Description:

This routine computes simple ordered statistics for an array, namely: the number of valid pixels, the minimum and maximum pixel values (and their positions), the pixel sum, the mean, the mode, the median, and selected percentiles. For efficiency reasons the routine computes an histogram, rather than completely sorting the data. The accuracy of the statistics therefore depends inversely on the number of bins.

Invocation

CALL KPG1_HSTAx( BAD, EL, DATA, NUMPER, PERCNT, NGOOD, IMIN, DMIN, IMAX, DMAX, SUM, MEAN, MEDIAN, MODE, PERVAL, 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.
NUMPER = INTEGER (Given)
Number of percentiles to evaluate.
PERCNT( NUMPER ) = REAL (Given and Returned)
The array of percentiles to evaluate. They must in the range 0.0 to 100.0. If there are none to calculate, set NUMPER to 1 and pass the bad value in PERCNT( 1 ). On exit these are placed in ascending order.
NGOOD = INTEGER (Returned)
Number of valid pixels in the array.
IMIN = INTEGER (Returned)
Index where the pixel with the lowest value was (first) found.
DMIN = DOUBLE PRECISION (Returned)
Minimum pixel value in the array.
IMAX = INTEGER (Returned)
Index where the pixel with the highest value was (first) found.
DMAX = DOUBLE PRECISION (Returned)
Maximum pixel value in the array.
SUM = DOUBLE PRECISION (Returned)
Sum of the valid pixels.
MEAN = DOUBLE PRECISION (Returned)
Mean of the valid pixels.
MEDIAN = DOUBLE PRECISION (Returned)
Median of the valid pixels.
MODE = DOUBLE PRECISION (Returned)
Mode of the valid pixels.
PERVAL( NUMPER ) = DOUBLE PRECISION (Returned)
Percentile values of the valid pixels. These correspond to the ordered fractions returned in PERCNT.
STATUS = INTEGER (Given and Returned)
The global status.

Notes:

References

Moroney, M.J., 1957, " Facts from Figures" (Pelican) Goad, L.E. 1980, in " Applications of Digital Image Processing to Astronomy" , SPIE 264, 139.

Deficiencies