next up previous 278
Next: CCG_WTM3x - Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers and estimating
Up: Routine Descriptions
Previous: CCG_WMD3x - Estimates the mean of a number of normally distributed data values, some of which may be corrupt


CCG_WTM2x - Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers

Description:
This routine finds a value which can be associated with the half- weight value. It sums all weights then finds a value for the half-weight. The comparison with the half-weight value proceeds in halves of the weights for each data point (half of the first weight, then the second half of the first weight and the first half of the second weight etc.) until the half weight is exceeded. The data values around this half weight position are then found and a linear interpolation of these values is the wtdmdn. The values which contribute to the result are flagged and passed through the USED array.

Invocation:
CALL CCG_WTM2x( EL. ORDDAT, WEIGHT, USED, RESULT, STATUS )

Arguments:

EL = INTEGER (Given)
The number of entries in the data array.
ORDDAT( EL ) = ? (Given)
The list of ordered data for which the weighted median is required
WEIGHT( EL ) = ? (Given)
The weights of the values.
USED = LOGICAL (Returned)
If a value contributes to the median value it is flagged as true in this array, otherwise the array is set to false.
RESULT = DOUBLE PRECISION (Returned)
The weighted median
STATUS = INTEGER (Given and Returned)
The global status.

Notes:

Prior Requirements



next up previous 278
Next: CCG_WTM3x - Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers and estimating
Up: Routine Descriptions
Previous: CCG_WMD3x - Estimates the mean of a number of normally distributed data values, some of which may be corrupt

KAPLIBS -- Internal subroutines used within the KAPPA package.
Starlink User Note 238
D.S. Berry
Malcolm J. Currie
9th March 2009
E-mail:ussc@star.rl.ac.uk

Copyright © 2010 Science and Technology Facilities Council