EleFits  4.0.1
A modern C++ API on top of CFitsIO
Classes | Macros
Binary table data classes

Detailed Description

Binary table data containers and tools.

ColumnInfo

ColumnInfo is the simple structure which stores the column metadata:

The repeat count represents the width of the column:

Column, PtrColumn, VecColumn

A Column is an abstract class composed of a ColumnInfo and some contiguous data. Analogously to Raster, two concrete classes are implemented, and others can be user-defined:

To write a column, any Column implementation works: you can even provide your own, e.g. some EigenColumn. Columns are always read as VecColumn instances. If you want to give or steal the data to or from a VecColumn, you can exploit move semantics, as shown in the Tutorial:

/* Initialize and later fill a column */
Fits::VecColumn<std::string> stringColumn({ "STRING", "unit", 3 }, 100);
// String columns must be wide-enough to hold each character.
for (long i = 0; i < stringColumn.rowCount(); ++i) {
stringColumn(i) = std::to_string(i);
}
// operator() takes two parameters: the row index, and repeat index (=0 by default)
/* Create a column from a vector */
// ... do what you have to do with the vector, and then move it to the column ...
Fits::VecColumn<std::int32_t> int32Column({ "INT32", "", 1 }, std::move(int32Vec));
// Analogously to rasters, columns can be managed with the lightweight PtrColumn classe.
/* Generate a random column */
auto float32Column = Fits::Test::RandomVectorColumn<float>(8, 100);

Segment, Indexed, Named

The following helpers are defined:

The latter two classes are very useful to specify which columns to read as which types. For example, to read several columns of different types, do:

columns.readSeq(Indexed<int>(1), Indexed<float>(3), Indexed<std::string>(8));

instead of:

columns.readSeq<int, float, std::string>({ 1, 3, 8 });

which would be error-prone when reading many columns.

Classes

struct  Euclid::Fits::ColumnInfo< T >
 Column metadata, i.e. { name, unit, repeatCount } and the value type as the template parameter. More...
 
class  Euclid::Fits::Column< T >
 Binary table column data and metadata. More...
 
class  Euclid::Fits::PtrColumn< T >
 Column which references some external pointer data. More...
 
class  Euclid::Fits::VecColumn< T >
 Column which stores internally the data. More...
 
struct  Euclid::Fits::Segment
 Bounds of a closed index interval. More...
 

Macros

#define ELEFITS_FOREACH_COLUMN_TYPE(MACRO)
 Loop over supported column types. More...
 
std::string
STL class.
std::move
T move(T... args)
std::vector
STL class.
std::to_string
T to_string(T... args)
std::int16_t
std::complex< float >