### AST_SETFITS$<$X$>$

Store a keyword value in a FitsChan

#### Description:

This is a family of routines which store values for named keywords within a FitsChan at the current card position. The supplied keyword value can either over-write an existing keyword value, or can be inserted as a new header card into the FitsChan.

The keyword data type is selected by replacing $<$X$>$ in the routine 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" parameter depends on $<$X$>$ as follows:

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

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

• F - DOUBLE PRECISION.

• I - INTEGER

• L - LOGICAL

• S - CHARACTER

• CN - CHARACTER

#### Invocation

CALL AST_SETFITS$<$X$>$( THIS, NAME, VALUE, COMMENT, OVERWRITE, 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.
##### VALUE = $<$X$>$type (Given)
The keyword value to store with the named keyword. The data type of this parameter depends on $<$X$>$ as described above.
##### COMMENT = CHARACTER $\ast$ ( $\ast$ ) (Given)
A string holding a comment to associated with the keyword. If a blank string is supplied, then any comment included in the string supplied for the NAME parameter is used instead. If NAME contains no comment, then any existing comment in the card being over-written is retained. Otherwise, no comment is stored with the card.
##### OVERWRITE = LOGICAL (Given)
If .TRUE., the new card formed from the supplied keyword name, value and comment string over-writes the current card, and the current card is incremented to refer to the next card (see the "Card" attribute). If .FALSE., the new card is inserted in front of the current card and the current card is left unchanged. In either case, if the current card on entry points to the " end-of-file" , the new card is appended to the end of the list.
##### STATUS = INTEGER (Given and Returned)
The global status.

#### Notes:

• The routine AST_SETFITSU can be used to indicate that no value is associated with a keyword.

• The routine AST_SETFITSCM can be used to store a pure comment card (i.e. a card with a blank keyword).

• To assign a new value for an existing keyword within a FitsChan, first find the card describing the keyword using AST_FINDFITS, and then use one of the AST_SETFITS$<$X$>$ family to over-write the old value.

• If, on exit, there are no cards following the card written by this routine, then the current card is left pointing at the " end-of-file" .

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