next up previous contents
Next: 6. Changing Keywords Up: CFHT FITS Handling Library Previous: 4. Examining Extensions and   Contents

Subsections

5. Looking at Keywords

5.1 fh_get_bool()

Returns FH_SUCCESS if `name' is found and contains either T or F (and not as a string, but as a `logical' FITS card.)

5.2 fh_get_int()

Returns FH_SUCCESS if `name' is found and contains a valid integer. A floating point value (with a decimal point) is not a valid integer. *value will contain the value as converted by the C strtol() function.

5.3 fh_get_flt()

Returns FH_SUCCESS if `name' is found and contains a valid float (real) value. *value will contain the result of the C strtod() function.

5.4 fh_get_str()

Returns FH_SUCCESS if `name' is found and contains a FITS string in single quotes ('...'). *value will contain a '$\backslash$0'-terminated list of (up to) the first maxlen characters. (Always pass buffers of (FH_MAX_STRLEN + 1) characters to be sure returned strings will not have to be truncated by the library.)

5.5 fh_first() and fh_next()

For access to each of the raw, 80 (FH_CARD_SIZE) records in the header, these functions can be used in a loop (see the ``second way'' in example fhlist.c).

5.6 fh_idx()

This returns the index of the card last returned by fh_next().

5.7 fh_search()

Use this to see if a keyword exists. A return of FH_SUCCESS means the keyword exists. If you pass a non-NULL pointer in `idx', the current `idx' will be returned in *idx.

5.8 fh_show()

Prints the first 79 columns of each card to stdout. Column 80 is replaced by a newline, so the terminal doesn't have to have exactly 80 columns to display properly, and the search-forward ('/' key) of `less' can be used. See the example fhlist.c.

5.9 fh_idx_before() and fh_idx_after()

Use these functions to obtain `idx' numbers which would cause a new card to appear just before or after an existing card. Note that if the ``new'' card already exists too, it will be replaced and will not be relocated in the header.

Pass the return of this function as the `idx' argument to the fh_set*() routines. Alternatively, you can pass FH_AUTO or a fixed value (see the section on `idx' numbers.)


next up previous contents
Next: 6. Changing Keywords Up: CFHT FITS Handling Library Previous: 4. Examining Extensions and   Contents
Jim Thomas
2013-12-19