Functions | |
| void | qfits_cache_purge (void) |
| Purge the qfits cache. | |
| int | qfits_query (const char *filename, int what) |
| Query a FITS file offset from the cache. | |
| void qfits_cache_purge | ( | void | ) |
Purge the qfits cache.
| int qfits_query | ( | const char * | filename, | |
| int | what | |||
| ) |
Query a FITS file offset from the cache.
| filename | Name of the file to examine. | |
| what | What should be queried (see below). |
This operation has side-effects: the cache is an automatically allocated structure in memory, that can only grow. Every request on a new FITS file will make it grow. The structure is pretty light-weight in memory, but nonetheless this is an issue for daemon-type programs which must run over long periods. The solution is to clean the cache using qfits_cache_purge() at regular intervals. This is left to the user of this library.
To request information about a FITS file, you must pass an integer built from the following symbols:
QFITS_QUERY_N_EXT QFITS_QUERY_HDR_START QFITS_QUERY_DAT_START QFITS_QUERY_HDR_SIZE QFITS_QUERY_DAT_SIZE Querying the number of extensions present in a file is done simply with:
next = qfits_query(filename, QFITS_QUERY_N_EXT);
Querying the offset to the i-th extension header is done with:
off = qfits_query(filename, QFITS_QUERY_HDR_START | i);
i.e. you must OR (|) the extension number with the QFITS_QUERY_HDR_START symbol. Requesting offsets to extension data is done in the same way:
off = qfits_query(filename, QFITS_QUERY_DAT_START | i);
Notice that extension 0 is the main header and main data part of the FITS file.