Functions | |
qfits_header * | qfits_header_new (void) |
FITS header constructor. | |
qfits_header * | qfits_header_default (void) |
FITS header default constructor. | |
void | qfits_header_add (qfits_header *hdr, const char *key, const char *val, const char *com, const char *lin) |
Add a new card to a FITS header. | |
void | qfits_header_add_after (qfits_header *hdr, const char *after, const char *key, const char *val, const char *com, const char *lin) |
add a new card to a FITS header | |
void | qfits_header_append (qfits_header *hdr, const char *key, const char *val, const char *com, const char *lin) |
Append a new card to a FITS header. | |
void | qfits_header_del (qfits_header *hdr, const char *key) |
Delete a card in a FITS header. | |
void | qfits_header_mod (qfits_header *hdr, const char *key, const char *val, const char *com) |
Modifies a FITS card. | |
int | qfits_header_sort (qfits_header **hdr) |
Sort a FITS header. | |
qfits_header * | qfits_header_copy (const qfits_header *src) |
Copy a FITS header. | |
void | qfits_header_destroy (qfits_header *hdr) |
qfits_header destructor | |
char * | qfits_header_getstr (const qfits_header *hdr, const char *key) |
Return the value associated to a key, as a string. | |
int | qfits_header_getitem (const qfits_header *hdr, int idx, char *key, char *val, char *com, char *lin) |
Return the i-th key/val/com/line tuple in a header. | |
char * | qfits_header_getcom (const qfits_header *hdr, const char *key) |
Return the comment associated to a key, as a string. | |
int | qfits_header_getint (const qfits_header *hdr, const char *key, int errval) |
Return the value associated to a key, as an int. | |
double | qfits_header_getdouble (const qfits_header *hdr, const char *key, double errval) |
Return the value associated to a key, as a double. | |
int | qfits_header_getboolean (const qfits_header *hdr, const char *key, int errval) |
Return the value associated to a key, as a boolean (int). | |
int | qfits_header_dump (const qfits_header *hdr, FILE *out) |
Dump a FITS header to an opened file. |
The 'keytuple' type is strictly internal to this module. It describes FITS cards as tuples (key,value,comment,line), where key is always a non-NULL character string, value and comment are allowed to be NULL. 'line' is a string containing the line as it has been read from the input FITS file (raw). It is set to NULL if the card is modified later. This allows in output two options: either reconstruct the FITS lines by printing key = value / comment in a FITS-compliant way, or output the lines as they were found in input, except for the modified ones.
The following functions are associated methods to this data structure:
|
Add a new card to a FITS header.
|
|
add a new card to a FITS header
|
|
Append a new card to a FITS header.
|
|
Copy a FITS header.
|
|
FITS header default constructor.
|
|
Delete a card in a FITS header.
|
|
qfits_header destructor
|
|
Dump a FITS header to an opened file.
|
|
Return the value associated to a key, as a boolean (int).
errval is returned if no matching key is found or no value is attached. A true value is any character string beginning with a 'y' (yes), a 't' (true) or the digit '1'. A false value is any character string beginning with a 'n' (no), a 'f' (false) or the digit '0'. |
|
Return the comment associated to a key, as a string.
Returns NULL if no matching key is found or no comment is attached. |
|
Return the value associated to a key, as a double.
|
|
Return the value associated to a key, as an int.
|
|
Return the i-th key/val/com/line tuple in a header.
int i ; char key[FITS_LINESZ+1] ; char val[FITS_LINESZ+1] ; char com[FITS_LINESZ+1] ; char lin[FITS_LINESZ+1] ; for (i=0 ; i<hdr->n ; i++) { qfits_header_getitem(hdr, i, key, val, com, lin); printf("card[%d] key[%s] val[%s] com[%s]\n", i, key, val, com); } This function has primarily been written to interface a qfits_header object to other languages (C++/Python). If you are working within a C program, you should use the other header manipulation routines available in this module. |
|
Return the value associated to a key, as a string.
Returns NULL if no matching key is found or no value is attached. |
|
Modifies a FITS card.
|
|
FITS header constructor.
|
|
Sort a FITS header.
|