#include <HDU.h>
Inheritance diagram for CCfits::HDU::
Public Methods | |
HDU (const HDU &right) | |
bool | operator== (const HDU &right) const |
bool | operator!= (const HDU &right) const |
virtual HDU* | clone (FITSBase *p) const=0 |
fitsfile* | fitsPointer () const |
virtual void | makeThisCurrent () const |
std::map<string, Keyword*> | keyWord () |
Keyword& | keyWord (const string &keyName) |
const string& | getHistory () |
const string& | getComments () |
void | writeHistory (const string &history="Generic History String") |
void | writeComment (const string &comment="Generic Comment") |
void | writeDate () |
FITSBase* | parent () const |
void | readAllKeys () |
long | axes () const |
long | axis (size_t index) const |
void | index (int value) |
void | deleteKey (const std::string &doomed) |
long | bitpix () const |
void | bitpix (long value) |
int | index () const |
const string& | history () const |
const string& | comment () const |
virtual double | zero () const |
virtual double | scale () const |
const std::map<string,Keyword*>& | keyWord () const |
const Keyword& | keyWord (const string &keyname) const |
void | setKeyWord (const string &keyname, Keyword &value) |
template<typename T> Keyword& | addKey (const string &name, T val, const string &comment) |
template<typename T> void | readKey (const string &keyName, T &val) |
template<typename T> void | readKeys (std::vector< string > &keyNames, std::vector< T > &vals) |
Protected Methods | |
HDU (FITSBase *p=0) | |
HDU (FITSBase *p, int bitpix, int naxis, const std::vector< long > &axes) | |
virtual | ~HDU () |
std::vector< long >& | naxes () |
HDU objects in CCfits are either PHDU (Primary HDU objects) or ExtHDU (Extension HDU) objects. Following the behavior. ExtHDUs are further subclassed into ImageExt or Table objects, which are finally AsciiTable or BinTable objects.
HDU's public interface gives access to properties that are common to all HDUs, largely required keywords, and functions that are common to all HDUs, principally the manipulation of keywords and their values.
HDUs must be constructed by HDUCreator objects which are called by FITS methods. Each HDU has an embedded pointer to a FITSBase object, which is private to FITS [FITSBase is a pointer encapsulating the resources of FITS. For details of this coding idiom see Exceptional C++ by Herb Sutter (2000) and references therein].
|
copy constructor.
|
|
default constructor, called by HDU subclasses that read from FITS files.
|
|
constructor for creating new HDU objects, called by HDU subclasses writing to FITS files.
|
|
destructor.
|
|
create a new keyword in the HDU with specified value and comment fields.
the function returns a reference to keyword object just created. Parameters:
It is possible however to create a keyword of any of the allowed data types in fitsio (see the cfitsio manual section 4.3). The required calls are, e.g. for a floating point double valued keyword: NewKeyword<double> keyCreate( hdu, double val1 ); Keyword* key1 = Keyword keyCreate.MakeKeyword(keyName1, const string& comment); keyCreate.keyData(val2); Keyword* key2 = Keyword keyCreate.MakeKeyword(keyName2, const string& comment); key1->write(); key2->write(); ... which is essentially what addKey does for its allowed types. |
|
return the number of axes in the HDU data section (always 2 for tables).
|
|
return the length of HDU data axis i.
|
|
set the data type keyword.
|
|
return the data type keyword.
Takes values denoting the image data type for images, and takes the fixed value 8 for tables. |
|
virtual copy constructor, to be implemented in subclasses.
Reimplemented in CCfits::AsciiTable, CCfits::BinTable, CCfits::ExtHDU, and CCfits::PHDU. |
|
return the comment string previously read by getComment().
|
|
delete a keyword from the header. |
|
return the fitsfile pointer for the FITS object containing the HDU.
|
|
read the comments from the HDU and add it to the FITS object. The comment string found in the header is concatenated and returned to the calling function |
|
read the history information from the HDU and add it to the FITS object. The history string found in the header is concatenated and returned to the calling function |
|
return the history string previously read by getHistory().
|
|
return the HDU number.
|
|
set the HDU number.
|
|
return a (previously read) keyword from the HDU object. const version.
|
|
return the associative array containing the HDU Keywords that have been read so far.
|
|
return a (previously read) keyword from the HDU object.
|
|
return the associative array containing the HDU keywords so far read.
|
|
move the fitsfile pointer to this current HDU.
This function should never need to be called by the user since it is called internally whenever required. Reimplemented in CCfits::ExtHDU. |
|
return the HDU data axis array.
|
|
inequality operator.
|
|
equality operator.
|
|
return reference to the pointer representing the FITSBase object containing the HDU.
|
|
read all of the keys in the header. This member function reads keys that are not meta data for columns or image information, [which are considered to be part of the column or image objects]. Also, history and comment keys are read and returned by getHistory() and getComment(). Note that readAllKeys can only construct keys of type string, float, complex<float>, integer, and bool because the FITS header records do not encode exact type information. |
|
read a keyword of specified type from the header of a disk FITS file and return its value.
T is one of the types std::string, float, int, std::complex<float>, and bool. |
|
read a set of specified keywords of the same data type from the header of a disk FITS file and return their values.
T is one of the types std::string, float, int, std::complex<float>, and bool. |
|
return the BSCALE keyword value.
Reimplemented in CCfits::PHDU. |
|
set Keyword keyname to specified value.
|
|
write a comment string. A default value for the string is given ("Generic Comment String") so users can put a placeholder call to this function in their code. |
|
write a date string to *this.
|
|
write a history string. A default value for the string is given ("Generic History String") so users can put a placeholder call to this function in their code. |
|
return the BZERO keyword value.
Reimplemented in CCfits::PHDU. |