Next: CCG_IWC1T - Combines data lines using the intensity-weighted co-ordinate
Up: Routine Descriptions
Previous: CCG_IS2x - Sorts a list of data into increasing order, and applies the corresponding shuffle to an ancillary list
CCG_IS3x
- Sorts a list of data into increasing order, and applies the
corresponding shuffle to two ancillary lists
- Description:
- The routine uses an insert sort method. This has proven itself
the quickest for sorting small sets of data lots of times, as in
image stacking using ordered statistics. The method looks at the
second value, compares this with the first if swaps if necessary,
then it looks at the third, looks at the previous values swaps
with the lowest (or not at all) and so on until all values have
been passed. It is fast (for the case above ) simply because of
the very few lines of operation. The sort is extended to the
ancillary data RDAT and PDAT that maintain their correspondence
with the ORDDAT dataset on exit.
- Invocation:
- CALL CCG_IS3x( EL, ORDDAT, RDAT, PDAT, STATUS )
- Arguments:
-
-
EL = INTEGER (Given)
-
The number of entries in ORDDAT.
-
ORDDAT( EL ) = ? (Given and Returned)
-
The data to order. On output it contains the data in increasing
order.
-
RDAT( EL ) = ? (Given and Returned)
-
A list of data associated with ORDDAT which needs to retain its
correspondence with the items in ORDDAT.
-
PDAT( EL ) = INTEGER (Given and Returned)
-
A list of data associated with ORDDAT which needs to retain its
correspondence with the items in ORDDAT (probably pointers).
-
STATUS = INTEGER (Given and Returned)
-
The global status.
- Notes:
- There is a routine for real and double-precision: replace "x"
in the routine name by D or R as appropriate. The ORDDAT and RDAT
arguments supplied to the routine must have the data type
specified.
Next: CCG_IWC1T - Combines data lines using the intensity-weighted co-ordinate
Up: Routine Descriptions
Previous: CCG_IS2x - Sorts a list of data into increasing order, and applies the corresponding shuffle to an ancillary list
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