KPG_NTHMx

Returns the n smallest values in an array

Description:

This routine takes an array and returns a stack containing the n smallest values in that array.

Bad pixels are processed by the magic-value method.

Invocation

CALL KPG1_NTHMx( BAD, ARRAY, DIMS, N, STACK, STATUS )

Arguments

BAD = LOGICAL (Given)
If true bad-pixel testing will be performed. It should be true if there may be bad pixels present.
ARRAY ( DIMS ) = ? (Given)
Input array of data values.
DIMS = INTEGER (Given)
Dimension of the input array.
N = INTEGER (Given)
The number of values to be stored in stack, i.e. specifies n in " n-th smallest value."
STACK ( N ) = ? (Returned)
Ordered n smallest values in the input array. The first element is the n-th smallest, the second is the (n-1)-th smallest and so on until the n-th element is the minimum value.
STATUS = INTEGER (Given)
Global status value.

Notes: