EleFits
4.0.1
A modern C++ API on top of CFitsIO
|
Wrapper classes to read and write Fits file contents.
There are two types of classes:
The following naming conventions are adopted:
Hdu
refers to both the Primary HDU and the extensions, while Ext
refers only to the extensions;read
and parse
means that some data are read from the Fits file;parse
differs from read
in that the raw contents of the Fits file are interpreted instead of being simply forwarded: for example, Header::parse()
returns a Record
with user-defined type by parsing the characters in the Fits file, while Hdu::readName()
returns the raw value of the EXTNAME
keyword.write
, init
and assign
means that some data are written to the Fits file;init
methods write metadata (e.g. image size) while assign
methods also write data (e.g. image pixels);Hdu::readName()
is a reading operation, while Hdu::index()
is a simple getter. Namespaces | |
Test | |
Test-related classes and functions. | |
Typedefs | |
using | VariantValue = boost::any |
The variant value type for records. More... | |
using | RecordSeq = RecordVec< VariantValue > |
A sequence of records of any type. | |
Enumerations | |
enum | FileMode { FileMode::Read, FileMode::Edit, FileMode::Create, FileMode::Overwrite, FileMode::Temporary } |
Fits file read/write permissions. More... | |
enum | RecordMode { RecordMode::CreateOrUpdate, RecordMode::CreateUnique, RecordMode::CreateNew, RecordMode::UpdateExisting } |
Record writing modes. More... | |
Classes | |
class | BintableColumns |
Column-wise reader-writer for the binary table data unit. More... | |
class | BintableHdu |
Binary table HDU reader-writer. More... | |
struct | ChecksumError |
Exception thrown if a checksum is missing or incorrect. More... | |
class | Column |
Binary table column data and metadata. More... | |
struct | ColumnInfo |
Column metadata, i.e. { name, unit, repeatCount } and the value type as the template parameter. More... | |
class | FileMemRegions |
Mapping between an in-file (Fits image data unit) region and an in-memory (raster) region for reading and writing image regions. More... | |
class | FileMemSegments |
Mapping between an in-file (Fits binary table data unit) segment and an in-memory (column) segment for reading and writing bintable segments. More... | |
class | FitsError |
Base of all exceptions thrown directly by the library. More... | |
class | FitsFile |
Fits file reader-writer. More... | |
class | Hdu |
Base class for ImageHdu and BintableHdu . More... | |
class | HduCategory |
An extensible HDU categorization for filtering and iteration. More... | |
class | HduFilter |
HDU filter built from HDU categories. More... | |
class | HduIterator |
Iterator for MefFile's HDUs. More... | |
class | HduSelector |
Helper class to provide filtered iterators. More... | |
class | Header |
Reader-writer for the header unit. More... | |
class | ImageHdu |
Image HDU reader-writer. More... | |
class | ImageRaster |
Reader-writer for the image data unit. More... | |
struct | Indexed |
An index and type. More... | |
class | KeywordCategory |
Keyword categories and related tools. More... | |
struct | KeywordExistsError |
Exception thrown when a keyword already exists. More... | |
struct | KeywordNotFoundError |
Exception thrown when a keyword is not found. More... | |
class | MefFile |
Multi-Extension Fits file reader-writer. More... | |
struct | Named |
A name and type. More... | |
class | OutOfBoundsError |
Exception thrown if a value lies out of given bounds. More... | |
struct | Position |
n-dimensional pixel position or image shape, i.e. set of integer coordinates. More... | |
class | PositionIterator |
A helper class to screen a Region . More... | |
class | ProgramOptions |
Helper class to declare positional and named options, and help message. More... | |
class | PtrColumn |
Column which references some external pointer data. More... | |
class | PtrRaster |
Raster of a n-dimensional image (2D by default). More... | |
class | Raster |
Raster of a n-dimensional image (2D by default). More... | |
class | ReadOnlyError |
Exception thrown if trying to write a read-only file. More... | |
struct | Record |
Keyword-value pair with optional unit and comment. More... | |
class | RecordVec |
A vector of records with find and conversion services. More... | |
struct | Region |
A n-D rectangle region, defined by its front and back positions (both inclusive), or front position and shape. More... | |
struct | Segment |
Bounds of a closed index interval. More... | |
class | SifFile |
Single image Fits file handler. More... | |
class | VecColumn |
Column which stores internally the data. More... | |
class | VecRaster |
Copy constructor. More... | |
Functions | |
template<typename T > | |
bool | operator== (const ColumnInfo< T > &lhs, const ColumnInfo< T > &rhs) |
ColumnInfo equality operator. | |
template<typename T > | |
bool | operator!= (const ColumnInfo< T > &lhs, const ColumnInfo< T > &rhs) |
ColumnInfo unequality operator. | |
template<typename TSeq > | |
constexpr bool | isTuple () |
Test whether a sequence is a tuple. | |
template<typename TReturn , typename TTuple > | |
TReturn | tupleAs (TTuple &&tuple) |
Convert a tuple to a custom structure. | |
template<typename TTuple , typename TFunc > | |
constexpr decltype(auto) | tupleApply (TTuple &&tuple, TFunc &&func) |
Apply a variadic function a tuple. | |
template<typename TSeq , typename TFunc > | |
std::enable_if_t< isTuple< TSeq >)> | seqForeach (TSeq &&seq, TFunc &&func) |
Apply a void-returning function to each element of a sequence. | |
template<typename TSeq , typename TFunc > | |
std::enable_if_t< not isTuple< TSeq >)> | seqForeach (const TSeq &seq, TFunc &&func) |
Apply a void-returning function to each element of a sequence. More... | |
template<typename TSeq , typename TFunc > | |
std::enable_if_t< not isTuple< TSeq >)> | seqForeach (TSeq &seq, TFunc &&func) |
Apply a void-returning function to each element of a sequence. More... | |
template<typename TReturn , typename TSeq , typename TFunc > | |
std::enable_if_t< isTuple< TSeq >), TReturn > | seqTransform (TSeq &&seq, TFunc &&func) |
Apply a transform to each element of a sequence and create a user-defined struct from the results. | |
template<typename TReturn , typename TSeq , typename TFunc > | |
std::enable_if_t< not isTuple< TSeq >), TReturn > | seqTransform (const TSeq &seq, TFunc &&func) |
Apply a transform to each element of a sequence and create a user-defined struct from the results. More... | |
template<typename TLogger , typename T0 , typename... Ts> | |
void | logArgs (TLogger &&logger, T0 &&arg0, Ts &&... args) |
Log a heterogeneous list of arguments. More... | |
HduFilter | operator+ (HduCategory lhs, HduCategory rhs) |
Combine two accepted categories as a filter. | |
HduFilter | operator- (HduCategory lhs, HduCategory rhs) |
Combine an accepted and rejected categories as a filter. | |
HduFilter | operator+ (HduCategory rhs) |
Consider a category as a filter with only this category as the accepted category. | |
HduFilter | operator- (HduCategory rhs) |
Consider a category as a filter with only this category as the rejected category. | |
template<long n = 2> | |
long | shapeSize (const Position< n > &shape) |
Compute the number of pixels in a given shape. | |
template<long n = 2> | |
Position< n > & | operator+= (Position< n > &lhs, const Position< n > &rhs) |
Add a position. | |
template<long n = 2> | |
Position< n > & | operator-= (Position< n > &lhs, const Position< n > &rhs) |
Subtract a position. | |
template<long n = 2> | |
Position< n > & | operator+= (Position< n > &lhs, long rhs) |
Add a scalar to each coordinate. | |
template<long n = 2> | |
Position< n > & | operator-= (Position< n > &lhs, long rhs) |
Subtract a scalar to each coordinate. | |
template<long n = 2> | |
Position< n > & | operator*= (Position< n > &lhs, long rhs) |
Multiply each coordinate by a scalar. | |
template<long n = 2> | |
Position< n > & | operator/= (Position< n > &lhs, long rhs) |
Divide each coordinate by a scalar. | |
template<long n = 2> | |
Position< n > & | operator++ (Position< n > &lhs) |
Add 1 to each coordinate. | |
template<long n = 2> | |
Position< n > & | operator-- (Position< n > &lhs) |
Subtract 1 to each coordinate. | |
template<long n = 2> | |
Position< n > | operator++ (Position< n > &lhs, int) |
Return the current position and then add 1 to each coordinate. | |
template<long n = 2> | |
Position< n > | operator-- (Position< n > &lhs, int) |
Return the current position and then subtract 1 to each coordinate. | |
template<long n = 2> | |
Position< n > | operator+ (const Position< n > &lhs) |
Identity. | |
template<long n = 2> | |
Position< n > | operator- (const Position< n > &lhs) |
Change the sign of each coordinate. | |
template<long n = 2> | |
Position< n > | operator+ (const Position< n > &lhs, const Position< n > &rhs) |
Add two positions. | |
template<long n = 2> | |
Position< n > | operator- (const Position< n > &lhs, const Position< n > &rhs) |
Subtract two positions. | |
template<long n = 2> | |
Position< n > | operator+ (const Position< n > &lhs, long rhs) |
Add a position and a scalar. | |
template<long n = 2> | |
Position< n > | operator- (const Position< n > &lhs, long rhs) |
Subtract a position and a scalar. | |
template<long n = 2> | |
Position< n > | operator* (const Position< n > &lhs, long rhs) |
Multiply a position by a scalar. | |
template<long n = 2> | |
Position< n > | operator/ (const Position< n > &lhs, long rhs) |
Divide a position by a scalar. | |
template<typename T , typename... Longs> | |
PtrRaster< T, sizeof...(Longs)> | makeRaster (T *data, Longs... shape) |
Shortcut to create a raster from a shape and data without specifying the template parameters. More... | |
template<typename T , typename... Longs> | |
VecRaster< T, sizeof...(Longs)> | makeRaster (std::vector< T > data, Longs... shape) |
Shortcut to create a raster from a shape and data without specifying the template parameters. More... | |
template<typename T > | |
bool | operator== (const Record< T > &lhs, const Record< T > &rhs) |
Check whether two records are equal. More... | |
template<typename T > | |
bool | operator!= (const Record< T > &lhs, const Record< T > &rhs) |
Check whether two records are different. | |
template<long n = 2> | |
bool | operator== (const Region< n > &lhs, const Region< n > &rhs) |
Check whether two regions are equal. | |
template<long n = 2> | |
bool | operator!= (const Region< n > &lhs, const Region< n > &rhs) |
Check whether two regions are different. | |
template<long n = 2> | |
Region< n > & | operator+= (Region< n > &lhs, const Position< n > &rhs) |
Add a position. | |
template<long n = 2> | |
Region< n > & | operator-= (Region< n > &lhs, const Position< n > &rhs) |
Subtract a position. | |
template<long n = 2> | |
Region< n > & | operator+= (Region< n > &lhs, long rhs) |
Add a scalar to each coordinate. | |
template<long n = 2> | |
Region< n > & | operator-= (Region< n > &lhs, long rhs) |
Subtract a scalar to each coordinate. | |
template<long n = 2> | |
Region< n > & | operator++ (Region< n > &lhs) |
Add 1 to each coordinate. | |
template<long n = 2> | |
Region< n > & | operator-- (Region< n > &lhs) |
Subtract 1 to each coordinate. | |
template<long n = 2> | |
Region< n > | operator++ (Region< n > &lhs, int) |
Return the current region and then add 1 to each coordinate. | |
template<long n = 2> | |
Region< n > | operator-- (Region< n > &lhs, int) |
Return the current region and then subtract 1 to each coordinate. | |
template<long n = 2> | |
Region< n > | operator+ (const Region< n > &rhs) |
Identity. | |
template<long n = 2> | |
Region< n > | operator- (const Region< n > &rhs) |
Change the sign of each coordinate. | |
template<long n = 2> | |
Region< n > | operator+ (const Region< n > &lhs, const Position< n > &rhs) |
Add a region and a positino. | |
template<long n = 2> | |
Region< n > | operator- (const Region< n > &lhs, const Position< n > &rhs) |
Subtract a region and a position. | |
template<long n = 2> | |
Region< n > | operator+ (const Region< n > &lhs, long rhs) |
Add a region and a scalar. | |
template<long n = 2> | |
Region< n > | operator- (const Region< n > &lhs, long rhs) |
Subtract a region and a scalar. | |
template<typename TSeq > | |
long | columnsRowCount (TSeq &&columns) |
The common number of rows of a sequence of columns. More... | |
template<long n> | |
FileMemRegions< n > | makeMemRegion (const Region< n > &memoryRegion) |
Create a FileMemRegions with in-file position at origin. | |
template<long n> | |
FileMemRegions< n > | makeMemRegion (const Position< n > &memoryPosition) |
Create a FileMemRegions with whole in-file region. | |
std::string | version () |
Version number of the EleFits project. | |
HduIterator | begin (MefFile &f) |
Beginning of an iterator to loop over all HDUs as Hdu s. | |
HduIterator | end (MefFile &f) |
End of an iterator to loop over all HDUs as Hdu s. | |
template<typename THdu = Hdu> | |
HduIterator< THdu > | begin (HduSelector< THdu > &selector) |
Beginning of an iterator to loop over selected HDUs. More... | |
template<typename THdu = Hdu> | |
HduIterator< THdu > | end (HduSelector< THdu > &selector) |
End of an iterator to loop over selected HDUs. | |