FITS Library
The baseline tool for handling FITS file in the context of the ELT ICS is CCfits. The underlying base library, cfitsio, may also be used in case some features are not found in the “CCfits” library.
Note
Note, “CCfits” is merely a wrapper around “cfitsio”.
However, in order to facilitate the creation and manipulation of FITS file, the FITS module of the DIT Component (ifw-core/dit/fits), provides some utilities to handle FITS files, mostly to generate FITS files from within ICS applications. This is particularly useful for the support of DID generation of keyword cards.
Note
If other FITS I/O tools are used than CCfits/cfitsio, the output produced by latter shall be the reference, and will supercede the output of alternative FITS I/O implementations.
It is strongly encouraged to use only CCfits/cfitsio for low level FITS file manipulation, to avoid possible inconsistencies/descrepancies.
The “ifw::core::dit::fits” module provides no classes, but merely a set of convenience functions.
Header Files, Library & Namespace
The “ifw::core::dit::fits” module provides only one header file “ifw/core/dit/fits/fits.hpp”.
The library to be used for linking is named “ifwCoreDitFitslib”.
The namespace is “ifw::core::dit::fits”.
Functions
The functions are documented in the Doxygen documentation for the “ifw::core::dit::fits” module.
Example
As mentioned, the baseline FITS I/O library for ELT ICS applications is CCfits, and if necessary, the underlying cfitsio.
The usage of these SDKs is explained in the pages referenced.
The “ifw::core::dit::fits” itself is quite simple. The following small example shows it is used:
#include "ifw/core/dit/did/fits.hpp"
dit::did::Did did;
did.Load("prj/pkg/mod/Test.did");
std::list<int32_t> naxes = {128, 256};
CCfits::FITS* fits_handle;
std::string target_filename;
dit::fits::CreateFile(&fits_handle, "Fits_CreateFile_tmp", did, -32, naxes,
target_filename, true);
delete fits_handle;
std::string target_filename2;
std::string hdr_buf;
dit::fits::ExtractHeaders("Fits_CreateFile_tmp", target_filename2, hdr_buf);
std::cout << std::endl << hdr_buf << std::endl;