KPG1_MEDUx

Derives the unweighted median of a vector

Description:

This routine derives the unweighted median of an array. If there are an even number of elements, the median is computed from the mean of the two elements that straddle the median.

Invocation

CALL KPG1_MEDUx( BAD, EL, ARRAY, MEDIAN, NELUSE, STATUS )

Arguments

BAD = LOGICAL (Given)
If BAD is .TRUE. there may be bad pixels present in the vector and so should be tested. If BAD is .FALSE. there is no testing for bad values.
EL = INTEGER (Given)
The number of elements within the array to sort.
ARRAY( EL ) = ? (Given and Returned)
The array whose median is to be found. On exit the array is partially sorted.
MEDIAN = ? (Returned)
The median of the array.
NELUSE = INTEGER (Returned)
The number of elements actually used after bad values have been excluded.
STATUS = INTEGER (Given and Returned)
The global status.

Notes: