CATSORT

Create a copy of a catalogue sorted on a specified column

Description:

Create a copy of a catalogue sorted on a specified column. Note that catsort generates a new sorted catalogue; it does not overwrite the original catalogue. The new catalogue can be sorted into either ascending or descending order. All the columns and parameters in the input catalogue are copied. Optionally any textual information associated with the input catalogue can also be copied.

Catalogues can be sorted on columns of any of the numeric data types. They should not be sorted on columns of data type CHARACTER or LOGICAL. If a catalogue is sorted on a column which contains null values then the rows for which the column is null will appear after all the rows with a valid value. The order of such rows is unpredictable.

Usage:

catsort

Parameters:

CATIN = CHARACTER (read)
Name of the input catalogue.
CATOUT = CHARACTER (read)
Name of the output catalogue, sorted on the specified column.
FNAME = CHARACTER (read)
The name of the column the output catalogue is to be sorted on.
ORDER = CHARACTER (read)
Order into which the catalogue is to be sorted: ascending or descending.
TEXT = CHARACTER (read)
Flag indicating the textual header information to be copied. The valid responses are: A - all; the output catalogue will contain a complete copy of the header information for the input catalogue, duplicated as comments, C - (default) copy only the comments from the input catalogue. In the case of a FITS table the COMMENTS and HISTORY keywords will be copied. N - none; no textual header information is copied.
QUIET = LOGICAL (read)
Operate in quiet mode where warnings are suppressed. The permitted values are: TRUE - quiet mode, FALSE - verbose mode.

Examples:

catsort
The following parameters will be prompted for: input catalogue, output catalogue, name of the column to be sorted on and the order required (ascending or descending). The sorted catalogue will then be created. Any comments in the input catalogue will be copied.
catsort text=all
The following parameters will be prompted for: input catalogue, output catalogue, name of the column to be sorted on and the order required (ascending or descending). The sorted catalogue will then be created. All the header information in the input catalogue will be duplicated as comments in the output catalogue.
catsort text=none
The following parameters will be prompted for: input catalogue, output catalogue, name of the column to be sorted on and the order required (ascending or descending). The sorted catalogue will then be created. Any comments in the input catalogue will not be copied.
catsort input-catalogue output-catalogue column-name ascending
Here the all the required parameters have been specified on the command line. Because no value was specified for parameter TEXT the default will be adopted and any comments in the input catalogue will be copied.

Pitfalls

Catalogues should not be sorted on columns of data type CHARACTER or LOGICAL.