EleFits
4.0.0
A modern C++ API on top of CFitsIO
|
#include <ImageHdu.h>
Image HDU reader-writer.
The Fits format can accommodate images of any dimension. EleFits stores them in n-dimensional containers: Raster objects. This is visible in the ImageHdu services as a template parameter n
.
When the dimension is known at compile time and fixed, it is recommended to specify it (n > 0
), which allows for a few internal optimizations and brings safety as the code is less error-prone with fewer degrees of freedom.
The zero vector space (n = 0
) is supported; It is used to represent HDUs with no data, as recommended in the Fits standard.
When the dimension is unknown at compile time, or is expected to change (e.g. 2D images to be merged as a 3D image), special value n = -1
can be specified. In this case, the dimension is read in the Fits file, but the user should be careful to handle all possible values.
Public Member Functions | |
virtual | ~ImageHdu ()=default |
Destructor. | |
const ImageRaster & | raster () const |
Access the data unit to read and write the raster. More... | |
const std::type_info & | readTypeid () const |
Read the image pixel value type. | |
long | readSize () const |
Read the number of pixels in the image. | |
template<long n = 2> | |
Position< n > | readShape () const |
Read the image shape. | |
HduCategory | readCategory () const override |
Read the category of the HDU. More... | |
template<typename T , long n = 2> | |
void | updateShape (const Position< n > &shape) const |
Redefine the image shape and type. | |
template<typename T , long n = 2> | |
VecRaster< T, n > | readRaster () const |
Read the Raster. | |
template<typename T , long n = 2> | |
void | writeRaster (const Raster< T, n > &data) const |
Write the Raster. | |
Public Member Functions inherited from Euclid::Fits::Hdu | |
virtual | ~Hdu ()=default |
Destructor. | |
long | index () const |
Get the 0-based index of the HDU. | |
HduCategory | type () const |
Get the type of the HDU. More... | |
bool | matches (HduFilter filter) const |
Check whether the HDU matches a given filter. More... | |
template<typename T > | |
const T & | as () const |
Cast to an ImageHdu or BintableHdu (if possible). | |
const Header & | header () const |
Access the header unit to read and write records. More... | |
std::string | readName () const |
Read the extension name. | |
long | readVersion () const |
Read the extension version. | |
void | updateName (const std::string &name) const |
Write or update the extension name. | |
void | updateVersion (long version) const |
Write or update the extension version. | |
void | verifyChecksums () const |
Compute the HDU and data checksums and compare them to the values in the header. More... | |
void | updateChecksums () const |
Compute and write (or update) the HDU and data checksums. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Euclid::Fits::Hdu | |
void | touchThisHdu () const |
Set the current HDU to this one. More... | |
void | editThisHdu () const |
Set the current HDU to this one for writing. More... | |
Protected Attributes inherited from Euclid::Fits::Hdu | |
fitsfile *& | m_fptr |
The parent file handler. More... | |
long | m_cfitsioIndex |
The 1-based CFitsIO HDU index. More... | |
HduCategory | m_type |
The HDU type. | |
Header | m_header |
The header unit handler. | |
HduCategory | m_status |
The HDU status. More... | |
fitsfile * | m_dummyFptr = nullptr |
Dummy file handler dedicated to dummy constructor. | |