KPG1_MMTHx

Returns the maximum and minimum values of an array within thresholds

Description:

This routine returns the maximum and minimum values of an input array, where it found the maximum and minimum, and the number of good and bad pixels in the 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.

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

Invocation

CALL KPG1_MMTHx( BAD, EL, ARRAY, 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.
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 or use routine KPG_MXMNx.
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: