Common Pipeline Library Reference Manual 6.0
|
defgroup cpl_io_fits Optimize open and close of FITS files
The CPL API for FITS I/O passes only the FITS file name, and per default opens and closes each file for each I/O operation. Since the FITS standard does not allow random access to a given extension, the open/close approach causes the writing of a file with N extensions to have complexity O(N^2). The same is true for reading all N extensions.
The complexity of those operations can be reduced to the expected O(N) by keeping the FITS files open between operations. This is done with static (thread-shared) storage of the relevant data.
#include "cpl_io_fits.h"