EleFits  5.0.0
A modern C++ API on top of CFITSIO
Public Member Functions | List of all members

#include <ImageHdu.h>

Detailed Description

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.

See also
Hdu for services to read and write records.
Position for details on the handling of fixed- and variable-dimension arrays.
ELEFITS_FOREACH_RASTER_TYPE and program EleFitsPrintSupportedTypes for the list of supported pixel On types.

Public Member Functions

virtual ~ImageHdu ()=default
 Destructor.
 
const ImageRasterraster () const
 Access the data unit to read and write the raster. More...
 
const std::type_inforeadTypeid () 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 TRaster >
void writeRaster (const TRaster &data) const
 Write the Raster.
 
- Public Member Functions inherited from 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
 View as an ImageHdu, ImageRaster, BintableHdu or BintableColumns (if possible).
 
const Headerheader () 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...
 

The documentation for this class was generated from the following file: