- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑
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:
-
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 NGOOD 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).
-
The median and percentiles are derived by linear interpolation within histogram
bins, after clipping of outliers if the histogram is sparse. The mode is estimated from
3median -
2mean,
which is only valid for moderately skew distributions.
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
- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑