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 adaptive compression, 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 the columns named "RA" and "DEC" in the 4th extension of a Multi-Extension FITS (MEF) file:
For a more realistic use case than the toy example above, let us rely on a classical demo: Create a Single Image FITS (SIF) file with a keyword record and an array. Here is a comparison of EleFits with the main alternatives:
For completeness, here are Python options:
In addition, exclusive features are provided to simplify the implementation of classical tasks. A few examples are given below.
Strategies are predefined or user-defined lists of actions to be performed automatically. Among strategies, compression strategies enables adaptive internal compression of image HDUs:
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:
Fields of mutidimensional columns can be accessed as rasters directly:
The tutorial composed of an example program and associated documentation is probably the good entry point for newcomers.
See the dedicated page.
The User Guide 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 ;)