### AST_GETFITS$<$X$>$

Get a named keyword value from a FitsChan

#### Description:

This is a family of functions which gets a value for a named keyword, or the value of the current card, from a FitsChan using one of several different data types. The data type of the returned value is selected by replacing $<$X$>$ in the function name by one of the following strings representing the recognised FITS data types:
• CF - Complex floating point values.

• CI - Complex integer values.

• F - Floating point values.

• I - Integer values.

• L - Logical (i.e. boolean) values.

• S - String values.

• CN - A " CONTINUE" value, these are treated like string values, but are encoded without an equals sign.

The data type of the " value" argument

depends on $<$X$>$ as follows:

• CF - DOUBLE PRECISION(2) (a 2 element array to hold the real and imaginary parts of the complex value).

• CI - INTEGER(2) (a 2 element array to hold the real and imaginary parts of the complex value).

• F - DOUBLE PRECISION.

• I - INTEGER

• L - LOGICAL

• S - CHARACTER

• CN - CHARACTER

#### Invocation

RESULT = AST_GETFITS$<$X$>$( THIS, NAME, VALUE, STATUS )

#### Arguments

##### THIS = INTEGER (Given)
Pointer to the FitsChan.
##### NAME = CHARACTER $\ast$ ( $\ast$ ) (Given)
A character string containing the FITS keyword name. This may be a complete FITS header card, in which case the keyword to use is extracted from it. No more than 80 characters are read from this string. If a single dot ’ .’ is supplied, the value of the current card is returned.
##### VALUE = $<$X$>$type (Returned)
A buffer to receive the keyword value. The data type depends on $<$X$>$ as described above. The conents of the buffer on entry are left unchanged if the keyword is not found.
##### STATUS = INTEGER (Given and Returned)
The global status.

#### Returned Value

##### AST_GETFITS$<$X$>$ = LOGICAL
.FALSE. is returned if the keyword was not found in the FitsChan (no error is reported). Otherwise, a value of .TRUE. is returned.

#### Notes:

• If a name is supplied, the card following the current card is checked first. If this is not the required card, then the rest of the FitsChan is searched, starting with the first card added to the FitsChan. Therefore cards should be accessed in the order they are stored in the FitsChan (if possible) as this will minimise the time spent searching for cards.

• If the requested card is found, it becomes the current card, otherwise the current card is left pointing at the " end-of-file" .

• If the stored keyword value is not of the requested type, it is converted into the requested type.

• If the keyword is found in the FitsChan, but has no associated value, an error is reported. If necessary, the AST_TESTFITS function can be used to determine if the keyword has a defined value in the FitsChan prior to calling this function.

• An error will be reported if the keyword name does not conform to FITS requirements.

• .FALSE. is returned as the function value if an error has already occurred, or if this function should fail for any reason.

• The FITS standard says that string keyword values should be padded with trailing spaces if they are shorter than 8 characters. For this reason, trailing spaces are removed from the string returned by AST_GETFITSS if the original string (including any trailing spaces) contains 8 or fewer characters. Trailing spaces are not removed from longer strings.