FTS1_PTKEY

Puts non-reserved keyword cards into the FITS extension of an NDF file

Description:

This subroutine inserts a number of non-reserved keyword cards into the FITS extension of an NDF file at the positions just before a specified keyword card. If a keyword card exists in the extension, the routine will move the card to the specified position. This provides a way to relocate the existing keyword card. If a keyword card does not exist in the extension, the routine will put the keyword card at the specified position and will add an equals sign to it, at column 9 for simple keywords or immediately after the keyword for compound ones. To those newly added keywords, a character value {undefined} is assigned. To write new values for these keywords, you should use subroutine FTS1_WKEYx.

Following keywords are regarded as reserved keywords: SIMPLE, BITPIX, NAXIS, NAXISn, EXTEND, PCOUNT, GCOUNT and XTENSION. Their order in the extension should be fixed and should not be changed by any routine. Therefore if any of them is included in the NAMES, it will be ignored.

This subroutine can not be used to insert comment cards, that is, the cards with keyword COMMENT or HISTORY , etc.

Invocation

CALL FTS1_PTKEY( FTSLOC, NKEY, NAMES, PSTNS, STATUS )

Arguments

FTSLOC = CHARACTER ( ) (Given)
The locator to the FITS extension of the NDF.
NKEY = INTEGER (Given)
The number of keyword cards to be inserted into the FITS extension.
NAMES( NKEY ) = CHARACTER ( ) (Given)
The names of the keywords to be inserted. This may be a compound name to handle hierarchical keywords, and it has the form keyword1.keyword2.keyword3 etc. The maximum number of keywords per FITS card is 20. Each keyword must be no longer than 8 characters. When inserted, the lower case letters are converted to uppercase and blanks are removed.
PSTNS( NKEY ) = CHARACTER ( ) (Given)
The names of the cards before which the corresponding new keyword cards are inserted. If any name in PSTNS does not exist in the original FITS card array or is blank, its corresponding new card will be inserted just before end-card or be appended to the original FITS card array when there is no end-card. If two or more new cards have the same PSTNS name, they will all be put before the PSTNS name in the same order as they are in NAMES.
STATUS = INTEGER (Given and Returned)
The global status.

Prior Requirements

The FITS extension is mapped for update access. It therefore must have some values assigned before using the routine.