CCG_FM1x

Combines data lines using a fast median

Description:

This routine accepts an array consisting a series of (vectorised) lines of data. The data values in the lines are then combined to form a (fast) median line. This method uses no weights and returns the estimated variances based on order stats for the population sizes used at each output pixel.

The method used is based on Wirth’s algorithm for selecting the Kth value, which is very fast compared with a full sort.

The output medians are returned in the array RESULT.

Invocation

CALL CCG_FM1x( NPIX, NLINES, STACK, VARS, MINPIX, NMAT, COVEC, RESULT, RESVAR, WRK1, WRK2, POINT, NCON, NBAD, STATUS )

Arguments

NPIX = INTEGER (Given)
The number of pixels in a line of data.
NLINES = INTEGER (Given)
The number of lines of data in the stack.
STACK( NPIX, NLINES ) = ? (Given)
The array of lines which are to be combined into a single line.
VARS( NPIX, NLINES ) = ? (Given)
The data variances.
MINPIX = INTEGER (Given)
The minimum number of pixels required to contribute to an output pixel.
NMAT = INTEGER (Given)
Size of the first dimension of COVEC.
COVEC( NMAT, NLINES ) = DOUBLE PRECISION (Given)
The packed variance-covariance matrix of the order statistics from a normal distribution of sizes up to NLINES, produced by CCG_ORVAR. This is only used when median is derived from the central-2 values.
RESULT( NPIX ) = ? (Returned)
The output line of data.
RESVAR( NPIX ) = ? (Returned)
The output variance.
WRK1( NLINES ) = ? (Returned)
Workspace for calculations.
WRK2( NLINES ) = ? (Returned)
Workspace for calculations.
POINT( NLINES ) = INTEGER (Returned)
Workspace to hold pointers to the original positions of the data before extraction and conversion in to the WRK1 array.
NCON( NLINES ) = DOUBLE PRECISION (Returned)
The actual number of contributing pixels from each input line to the output line.
NBAD = INTEGER (Returned)
The number of bad values in the output array created while forming the statistics. It excludes those bad values whose corresponding values along the collapse axis are all bad.
STATUS = INTEGER (Given and Returned)
The global status.

Notes: