Functions | |
| char * | qfits_query_hdr (const char *filename, const char *keyword) |
| Retrieve the value of a key in a FITS header. | |
| char * | qfits_query_ext (const char *filename, const char *keyword, int xtnum) |
| Retrieve the value of a keyin a FITS extension header. | |
| int | qfits_query_n_ext (const char *filename) |
| Counts the number of extensions in a FITS file. | |
| int | qfits_query_nplanes (const char *filename, int extnum) |
| Counts the number of planes in a FITS extension. | |
| char * | qfits_pretty_string (const char *s) |
| Clean out a FITS string value. | |
| int | qfits_is_boolean (const char *s) |
| Identify if a FITS value is boolean. | |
| int | qfits_is_int (const char *s) |
| Identify if a FITS value is an int. | |
| int | qfits_is_float (const char *s) |
| Identify if a FITS value is float. | |
| int | qfits_is_complex (const char *s) |
| Identify if a FITS value is complex. | |
| int | qfits_is_string (const char *s) |
| Identify if a FITS value is string. | |
| int | qfits_get_type (const char *s) |
| Identify the type of a FITS value given as a string. | |
| char * | qfits_query_card (const char *filename, const char *keyword) |
| Query a card in a FITS (main) header by a given key. | |
| int | qfits_replace_card (const char *filename, const char *keyword, const char *substitute) |
| Replace a card in a FITS (main) header by a given card. | |
| const char * | qfits_version (void) |
| Return the current QFITS version. | |
| int qfits_get_type | ( | const char * | s | ) |
Identify the type of a FITS value given as a string.
| s | FITS value as a string |
| int qfits_is_boolean | ( | const char * | s | ) |
Identify if a FITS value is boolean.
| s | FITS value as a string |
| int qfits_is_complex | ( | const char * | s | ) |
Identify if a FITS value is complex.
| s | FITS value as a string |
| int qfits_is_float | ( | const char * | s | ) |
Identify if a FITS value is float.
| s | FITS value as a string |
| int qfits_is_int | ( | const char * | s | ) |
Identify if a FITS value is an int.
| s | FITS value as a string |
| int qfits_is_string | ( | const char * | s | ) |
Identify if a FITS value is string.
| s | FITS value as a string |
| char* qfits_pretty_string | ( | const char * | s | ) |
Clean out a FITS string value.
| s | pointer to allocated FITS value string. |
Examples:
| char* qfits_query_card | ( | const char * | filename, | |
| const char * | keyword | |||
| ) |
Query a card in a FITS (main) header by a given key.
| filename | Name of the FITS file to check. | |
| keyword | Where to read a card in the header. |
| char* qfits_query_ext | ( | const char * | filename, | |
| const char * | keyword, | |||
| int | xtnum | |||
| ) |
Retrieve the value of a keyin a FITS extension header.
| filename | name of the FITS file to browse. | |
| keyword | name of the FITS key to look for. | |
| xtnum | xtension number |
| char* qfits_query_hdr | ( | const char * | filename, | |
| const char * | keyword | |||
| ) |
Retrieve the value of a key in a FITS header.
| filename | Name of the FITS file to browse | |
| keyword | Name of the keyword to find |
The input keyword is first converted to upper case and expanded to the HIERARCH scheme if given in the shortFITS notation.
This function is pretty fast due to the mmapping. Due to buffering on most Unixes, it is possible to call many times this function in a row on the same file and do not suffer too much from performance problems. If the file contents are already in the cache, the file will not be re-opened every time.
It is possible, though, to modify this function to perform several searches in a row. See the source code.
Returns NULL in case the requested keyword cannot be found.
| int qfits_query_n_ext | ( | const char * | filename | ) |
Counts the number of extensions in a FITS file.
| filename | Name of the FITS file to browse. |
| int qfits_query_nplanes | ( | const char * | filename, | |
| int | extnum | |||
| ) |
Counts the number of planes in a FITS extension.
| filename | Name of the FITS file to browse. | |
| extnum | Extensin number |
| int qfits_replace_card | ( | const char * | filename, | |
| const char * | keyword, | |||
| const char * | substitute | |||
| ) |
Replace a card in a FITS (main) header by a given card.
| filename | Name of the FITS file to modify. | |
| keyword | Where to substitute a card in the header. | |
| substitute | What to replace the line with. |
The input keyword is first converted to upper case and expanded to the HIERARCH scheme if given in the shortFITS notation.
Returns 0 if everything worked Ok, -1 otherwise.
| const char* qfits_version | ( | void | ) |
Return the current QFITS version.