KPG1_MXMEx

Returns the maximum and minimum values between thresholds of an array including its errors

Description:

This routine returns the maximum and minimum values of an input array when combined with its associated error array. The extreme values can be constrained to lie between two thresholds, where values outside the thresholds are ignored. So for example this routine might be used to find the smallest positive value or the largest negative value. The number of multiples of each error that should be added to and subtracted from the primary array to find the extreme values is adjustable. The routine also returns where it found the maximum and minimum, and the number of elements where either or both of the array values is bad.

An error report is made if all the values are bad or lie outside of the thresholds.

Invocation

CALL KPG1_MXMEx( BAD, EL, ARRAY, ERROR, NSIGMA, THRESH, NINVAL, MAXMUM, MINMUM, MAXPOS, MINPOS, STATUS )

Arguments

BAD = LOGICAL (Given)
If .TRUE., there may be bad pixels present in the array. If .FALSE., it is safe not to check for bad values.
EL = INTEGER (Given)
The dimension of the input array.
ARRAY( EL ) = ? (Given)
Input array of data.
ERROR( EL ) = ? (Given)
Error array associated with the data array.
NSIGMA = REAL (Given)
Number of multiples of the error.
THRESH( 2 ) = ? (Given)
The thresholds between which the extreme values are to be found (lower then upper). Values equal to the thresholds are excluded. To find the extreme values across the full range, set the thresholds to VAL__MINx and VAL__MAXx.
NINVAL = INTEGER (Returned)
Number of bad pixels in the array.
MAXMUM = ? (Returned)
Maximum value found in the array.
MINMUM = ? (Returned)
Minimum value found in the array.
MAXPOS = INTEGER (Returned)
Index of the pixel where the maximum value is (first) found.
MINPOS = INTEGER (Returned)
Index of the pixel where the minimum value is (first) found.
STATUS = INTEGER (Given)
Global status value

Notes: