int fits_get_hdrspace / ffghsp (fitsfile *fptr, > int *keysexist, int *morekeys, int *status)
The second routine returns the keyword value as a character string (a literal copy of what is in the value field) regardless of the intrinsic data type of the keyword. The third routine returns the entire 80-character header record of the keyword, with any trailing blank characters stripped off. The fourth routine returns the (next) header record that contains the literal string of characters specified by the 'string' argument.
If a NULL comment pointer is supplied then the comment string will not be returned.
int fits_read_key / ffgky (fitsfile *fptr, int datatype, char *keyname, > DTYPE *value, char *comment, int *status) int fits_read_keyword / ffgkey (fitsfile *fptr, char *keyname, > char *value, char *comment, int *status) int fits_read_card / ffgcrd (fitsfile *fptr, char *keyname, > char *card, int *status) int fits_read_str / ffgstr (fitsfile *fptr, char *string, > char *card, int *status)
The first routine, ffgkcsl, simply returns the lengths of the character string value and comment string (if any) of the specified keyword. These lengths are particularly helpful for allocating dynamic memory when retrieving the strings in the ffgskyc function. To create an array large enough to hold the full string, one should allocate a size equal to the returned length + 1 (for the trailing NULL).
The second routine, ffgskyc, is for retrieving the value string and optional comment string, both of which may be of arbitrary length spreading over multiple lines with the CONTINUE keyword convention. It will return up to maxchar characters of the keyword value string, starting with the firstchar character. Similarly, maxcomchar determines the maximum number of characters to return for the comment string. (The valuelen and comlen arguments return the total length of their respective strings regardless of what is actually returned as determined from the firstchar and max(com)char arguments.) If NULL is passed for either the value or comm string pointer, its max(com)char setting is irrelevant since the corresponding string will not be returned.
The ffgksl routine is the earlier version of ffgkcsl. It only returns the value string length and not the comment string length. ffgsky, the earlier version of ffgskyc, does return both the value string and comment string. However it will only return up to the first FLEN_COMMENT-1 characters of the comment. It can read comments across multiple lines, but not of arbitrary length.
int fits_get_key_com_strlen / ffgkcsl (fitsfile *fptr, const char *keyname, int *length, int *comlength, int *status); int fits_read_string_key_com / ffgskyc (fitsfile *fptr, const char *keyname, int firstchar, int maxchar, int maxcomchar, char *value, int *valuelen, char *comm, int *comlen, int *status); int fits_get_key_strlen / ffgksl (fitsfile *fptr, const char *keyname, int *length, int *status); int fits_read_string_key / ffgsky (fitsfile *fptr, const char *keyname, int firstchar, int maxchar, char *value, int *valuelen, char *comm, int *status);
int fits_read_record / ffgrec (fitsfile *fptr, int keynum, > char *card, int *status) int fits_read_keyn / ffgkyn (fitsfile *fptr, int keynum, > char *keyname, char *value, char *comment, int *status)
int fits_find_nextkey / ffgnxk (fitsfile *fptr, char **inclist, int ninc, char **exclist, int nexc, > char *card, int *status)
VELOCITY= 12.3 / [km/s] orbital speed int fits_read_key_unit / ffgunt (fitsfile *fptr, char *keyname, > char *unit, int *status)
There are 2 related routines: fits_hdr2str simply concatenates all the existing keywords in the header; fits_convert_hdr2str is similar, except that if the CHDU is a tile compressed image (stored in a binary table) then it will first convert that header back to that of the corresponding normal FITS image before concatenating the keywords.
Selected keywords may be excluded from the returned character string. If the second parameter (nocomments) is TRUE (nonzero) then any COMMENT, HISTORY, or blank keywords in the header will not be copied to the output string.
The 'exclist' parameter may be used to supply a list of keywords that are to be excluded from the output character string. Wild card characters (*, ?, and #) may be used in the excluded keyword names. If no additional keywords are to be excluded, then set nexc = 0 and specify NULL for the the **exclist parameter.
int fits_hdr2str / ffhdr2str (fitsfile *fptr, int nocomments, char **exclist, int nexc, > char **header, int *nkeys, int *status) int fits_convert_hdr2str / ffcnvthdr2str (fitsfile *fptr, int nocomments, char **exclist, int nexc, > char **header, int *nkeys, int *status) int fits_free_memory / fffree (char *header, > int *status);