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, latter 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-hl/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 “dit::fits” module provides no classes, but merely a set of convenience functions.

The Doxygen documentation for the “dit::fits” module is available here.

Header Files, Library & Namespace

The “dit::fits” module provides only one header file “dit/fits/fits.hpp”.

The library to be used for linking is named “ifwDitFits”.

The namespace is “dit::fits”.

Functions

The functions are documented in the Doxygen documentation for the “dit::fits” module, which can be found here.

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 “dit::fits” itself is quite simple, but the following small example is provided to to give an idea of how it is used:

#include "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;