FTS1_FTWCS

Uses co-ordinate system information in the supplied FITS headers to create WCS and AXIS components in an NDF

Description:

This constructs an AST FrameSet from the supplied FITS headers and adds it into the existing WCS information in the supplied NDF. It can also create AXIS structures (see below).

The information needed to create the FrameSet can be stored several times in a single FITS header, using different keywords each time. Each of these descriptions is known as an " encoding" and AST supports several different encoding schemes (e.g. FITS-WCS, FITS-IRAF, DSS, NATIVE). If the supplied FITS header contains more than one encoding then we need to choose which one to use. This decision is important because is is possible for encodings to be inconsistent (i.e. software may modify one encoding without making equivalent modifications to the other encodings). The simplest way to make this decision is to hand responsibility for it over to the user. In this case, the user supplies a list of preferred encodings, and the first of these encodings that exists in the FITS header gets used. If the user does not know which encoding to use, then we can make an intelligent guess by comparing the encodings to see which ones are consistent and which ones are not.

In addition to the WCS component, this routine also creates AXIS Centre, Label and Units components in the NDF, but only if they do not already exist, and if the FrameSet read from the FITS header contains an AXIS Frame. NDF2FITS does not write out the AXIS Frame if it is equivalent to pixel co-ordinates, and so no AXIS structures will be created by this routine in this case. Also, if the AXIS Frame represents linear axis co-ordinates, then there will already be AXIS structures in the NDF (created earlier within FITSIN), and so again no AXIS structures will be created by this routine. Thus, this routine will only create AXIS structures in the cases where the axis co-ordinates are non-linear.

Invocation

CALL FTS1_FTWCS( NCARD, HEADER, SCARD, INDF, NENCOD, ENCODS, STATUS )

Arguments

NCARD = INTEGER (Given)
The number of cards in the array of headers, from the start of the first header section to the end of the current one.
HEADER( NCARD ) = CHARACTER 80 (Given)
The buffer containing the header card images.
SCARD = INTEGER (Given)
The number of the card from where searches will begin, and copying of the headers to the FITS extension. Therefore NCARD - SCARD + 1 headers will appear in the extension. This argument is needed because the headers make contain a dummy header prior to an extension.
INDF = INTEGER (Given)
The NDF identifier.
NENCOD = INTEGER (Given)
The number of encodings supplied in ENCODS.
ENCODS( NENCOD ) = CHARACTER ( ) (Given)
The user s preferred AST encodings. If NENCOD is zero, then this is ignored, and an intelligent guess is made as to which encoding to use (see FTS1_WCSIM).
STATUS = INTEGER (Given and Returned)
The global status.