FTS1_GKEYx

Gets the value and comment of a named header from a buffer of FITS-header card images

Description:

This routine searches a buffer containing the header card images from a FITS file for a keyword NAME; and returns its value and comment, and the number of the card image within the buffer array that contains the named keyword. The search ends when the next end of a header block, marked by the END keyword, is encountered or the buffer is exhausted. If the keyword is present, THERE is .TRUE., otherwise it is .FALSE. Since all cards images are in character format, type conversion is performed. An error status will be returned if the conversion has failed. If the keyword expected to be present more than once, then the argument NOCCUR controls which occurrence will be retrieved. If a keyword is not found, then no error results and the argument VALUE remains unmodified.

The name may be compound to permit reading of hierarchical keywords. This routine will probably only work for HISTORY, COMMENT and (blank) if there is just one value given on the line, i.e. only one " keyword = value" before any comment marker. An error will result otherwise.

Invocation

CALL FTS1_GKEYx( NCARD, BUFFER, SCARD, NAME, NOCCUR, THERE, VALUE, COMENT, CARD, STATUS )

Arguments

NCARD = INTEGER (Given)
The number of card images in the buffer.
BUFFER( NCARD ) = CHARACTER 80 (Given)
The buffer containing the header card images.
SCARD = INTEGER (Given)
The number of the card from where the search will begin. This is needed because the headers may contain a dummy header prior to an extension.
NAME = CHARACTER ( ) (Given)
The name of the keyword whose value is required. 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. Comparisons are performed in uppercase and blanks are removed. Each keyword must be no longer than 8 characters.
NOCCUR = INTEGER (Given)
The value of this argument specifies which occurrence of a keyword should be used, if multiple ones are expected. Any value less than or equal to 1 indicates the first occurrence.
THERE = LOGICAL (Returned)
If .TRUE., the keyword given by argument NAME is present, regardless of the exit status.
VALUE = ? (Returned)
The value of the keyword.
COMENT = CHARACTER ( ) (Returned)
The comment associated with the keyword.
CARD = INTEGER (Returned)
The number of the card containing the named keyword. If the card could not be found this is set to zero.
STATUS = INTEGER (Given)
Global status value.

Notes: