EleFits (Euclid libraries and executables for FITS) is a modern C++ package to read and write FITS files which focuses on safety, user-friendliness, and performance. EleFits provides the only C++ FITS library which features a fully consistent and optimal internal type management system. Nevertheless, the API is templated and agnostic of the underlying architecture, which makes usage straightforward. EleFits is compact and involves as few parameters as possible, which makes it both simple and robust. As compared to CFITSIO, the benefits are mainly those of C++ over C:
Furthermore, exclusive features are provided, like HDU selectors and automatic buffering of binary tables.
To maximize performance, EleFits is built as a CFITSIO wrapper as thin as possible. While the two libraries are generally equivalent, optimizations implemented internally make EleFits even faster in some classical cases, unless the CFITSIO user spends considerable development efforts.
The EleFits API was specifically designed to be very fluent and compact. The following (a bit extreme) example shows how natural it is to read a column named "RA" in the 4th extension of a Multi-Extension FITS (MEF) file:
A more realistic example is creating a Single Image FITS (SIF) file with a keyword record and an array:
In addition, exclusive features are provided to simplify the implementation of classical use cases. A few examples are given below.
Files are iterable, and selectors enable looping over filtered HDUs (here, newly created image HDUs):
Heterogeneous collections of keyword records can be parsed and written, and a comprehensive type conversion system is provided:
Images and tables can be read and written region-wise by mapping – possibly non-contiguous – in-file and in-memory regions, e.g.:
For binary tables, multiple columns can be read or written at once to take advantage of an internal buffer:
The tutorial composed of an example program and associated documentation is probably the good entry point for newcomers.
See the dedicated page.
The Modules page is the main entry point for usage documentation. Each so-called documentation module addresses a specific topic to learn how to use EleFits and understand why it is designed the way it is. The API documentation of related namespaces, classes and functions is linked at the bottom of each module page.
To go further, many other topics are discussed in the Related pages, as unordered documents. Among others, you'll find there thoughts on CFITSIO, the tutorial, and some design documentation.
Bug reports, reviews, change requests and other feedbacks are welcome! Feel free to open issues ;)