[Previous] [Next] [Up] [Top]

### NAME

ft_cardfmt,ft_cardkey,ft_cardset,ft_cardsetl,ft_cardseti,ft_cardsetr,ft_cardsets,ft_cardclr,ft_cardcpy - Fitsy FITS card set routines.

### SYNOPSIS

    FITSCard ft_cardfmt(FITSCard card, char *name, int n, FITSType type, void *value, int prec, char *comm);
    FITSCard ft_cardkey(FITSCard card, char *name, int n);
    FITSCard ft_cardset(FITSCard card, FITSType type, void *value, int prec, char *comm);
    FITSCard ft_cardsetl(FITSCard card, int lvalue, char *comm);
    FITSCard ft_cardseti(FITSCard card, int ivalue, char *comm);
    FITSCard ft_cardsetr(FITSCard card, double rvalue, int prec, char *comm);
    FITSCard ft_cardsets(FITSCard card, char *svalue, char *comm);
    FITSCard ft_cardclr(FITSCard card, int ncards);
    FITSCard ft_cardcpy(FITSCard card1, FITSCard card2);

### PARAMETERS

- FITSCard card - FITS card to format.
- char *name - keyword name.
- int n - keyword index number, if is zero no index number is appended to the keyword.
- FITSType type - type of the card.

  Possible values for a FITSType are as follows:

  - FT_COMMENT
  - FT_LOGICAL
  - FT_INTEGER
  - FT_STRING
  - FT_VALUE
  - FT_REAL
  - FT_COMPLEX

- void *value - pointer to the value to format. The pointer must be of the apropriate type.
- int prec - If type is FT_REAL the value is formatted at this precision. Otherwise this parameter is ignored.
- char *comm - Comment for the card.
- int lvalue - Logical to format as a FITS value.
- int ivalue - Integer to format as a FITS value.
- double rvalue - Double to format as a FITS value.
- char *svalue - String to format as a FITS value.
- int ncards - Number of 80 character FITS cards to clear
- FITSCard card1 - Destination card
- FITSCard card2 - Source card

### DESCRIPTION

#### ft_cardfmt

Format a FITS card with the supplied values.

#### ft_cardkey

Format a keyword into a FITS card.

#### ft_cardset

Format a value into a FITS card.

#### ft_cardsetl

Format a logical value into a FITS card.

#### ft_cardseti

Format an integer value into a FITS card.

#### ft_cardsetr

Format a real value into a FITS card.

#### ft_cardsets

Format a string value into a FITS card.

#### ft_cardclr

Clear FITS cards by writing space into them.

#### ft_cardcpy

Copy a FITS card.

### EXAMPLES

Format the keyword part of a card:

                    FITSHead        fits;
                    FITSBuff        card;
                    FITSCard        here;

            ft_cardclr(&card, 1);                  /* Clear out the card first             */

            ft_cardkey(&card, "RA");                       /* Set the keyword              */
            ft_cardsetr(&card, 14.789, 3, "OBS RA");       /* Set the value of RA.         */

            here = ft_cardapp(fits, &card);                /* Put the new card into a header*/

            ft_cardsetr(here, 15.567, 3, FT_Comment);      /* Set a new value after it's in
                                                               the header and reuse the existing
                                                               comment */

Format the value part of a card:

                    int     l = 1;
                    int     i = 15;
                    double  d = 34.7;
                    char   *c = "Shutter";

                    FITSHead        fits;
                    FITSCard        card;

            /* Get a card pointer from the header
             */
            card = ft_cardfind(fits, "Keyword", 0);

            ft_cardsetl(card, l, "A true value");
            ft_cardseti(card, i, "15 is the number");
            ft_cardsetr(card, d, 4, "Four digits of precision here");

            /* In this example the special pointer FT_Comment is used to
               use the existing comment in the card.
             */
            ft_cardsets(card, c, FT_Comment);

[Previous] [Next] [Up] [Top]