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. |
|
Purge the qfits cache.
|
|
Query a FITS file offset from the cache.
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:
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
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. |