GammaLib 2.0.0
Loading...
Searching...
No Matches
GFitsBinTable Class Reference

FITS binary table class. More...

#include <GFitsBinTable.hpp>

Inheritance diagram for GFitsBinTable:
GFitsTable GFitsHDU GBase

Public Member Functions

 GFitsBinTable (void)
 Void constructor.
 
 GFitsBinTable (const int &nrows)
 Table constructor.
 
 GFitsBinTable (const GFitsBinTable &table)
 Copy constructor.
 
virtual ~GFitsBinTable (void)
 Destructor.
 
GFitsBinTableoperator= (const GFitsBinTable &table)
 Assignment operator.
 
virtual void clear (void)
 Clear binary table.
 
virtual GFitsBinTableclone (void) const
 Clone binary table.
 
virtual std::string classname (void) const
 Return class name.
 
HDUType exttype (void) const
 Return extension type.
 
- Public Member Functions inherited from GFitsTable
 GFitsTable (void)
 Void constructor.
 
 GFitsTable (const int &nrows)
 Table constructor.
 
 GFitsTable (const GFitsTable &table)
 Copy constructor.
 
virtual ~GFitsTable (void)
 Destructor.
 
GFitsTableoperator= (const GFitsTable &table)
 Assignment operator.
 
GFitsTableColoperator[] (const int &colnum)
 Returns pointer to table column.
 
const GFitsTableColoperator[] (const int &colnum) const
 Returns pointer to table column (const version)
 
GFitsTableColoperator[] (const std::string &colname)
 Returns pointer to table column.
 
const GFitsTableColoperator[] (const std::string &colname) const
 Returns pointer to table column (const version)
 
GFitsTableColset (const int &colnum, const GFitsTableCol &column)
 Set column.
 
GFitsTableColset (const std::string &colname, const GFitsTableCol &column)
 Set column.
 
GFitsTableColappend (const GFitsTableCol &column)
 Append column to the table.
 
GFitsTableColinsert (int colnum, const GFitsTableCol &column)
 Insert column into the table.
 
GFitsTableColinsert (const std::string &colname, const GFitsTableCol &column)
 Insert column into the table.
 
void remove (const int &colnum)
 Remove column from the table.
 
void remove (const std::string &colname)
 Remove column from the table.
 
void append_rows (const int &nrows)
 Append rows to the table.
 
void insert_rows (const int &row, const int &nrows)
 Insert rows into the table.
 
void remove_rows (const int &row, const int &nrows)
 Remove rows from the table.
 
const int & nrows (void) const
 Return number of rows in table.
 
const int & ncols (void) const
 Return number of columns in table.
 
bool contains (const std::string &colname) const
 Checks the presence of a column in table.
 
std::string print (const GChatter &chatter=NORMAL) const
 Print table information.
 
- Public Member Functions inherited from GFitsHDU
 GFitsHDU (void)
 Void constructor.
 
 GFitsHDU (const GFitsHDU &hdu)
 Copy constructor.
 
virtual ~GFitsHDU (void)
 Destructor.
 
GFitsHDUoperator= (const GFitsHDU &hdu)
 Assignment operator.
 
int cards (void) const
 Return number of cards in HDU header.
 
const std::string & extname (void) const
 Return extension name.
 
void extname (const std::string &extname)
 Set HDU extension name (EXTNAME keyword)
 
const int & extno (void) const
 Return extension number.
 
void extno (const int &extno)
 Set extension number.
 
const GFitsHeaderheader (void) const
 Return extension header.
 
void header (const GFitsHeader &header)
 Set extension header.
 
bool has_card (const int &cardno) const
 Check existence of header card.
 
bool has_card (const std::string &keyname) const
 Checks for presence of header card.
 
GFitsHeaderCardcard (const int &cardno)
 Return header card.
 
const GFitsHeaderCardcard (const int &cardno) const
 Return header card (const version)
 
GFitsHeaderCardcard (const std::string &keyname)
 Return header card.
 
const GFitsHeaderCardcard (const std::string &keyname) const
 Return header card (const version)
 
void card (const GFitsHeaderCard &card)
 Append or update header card.
 
void card (const std::string &keyname, const std::string &value, const std::string &comment)
 Append or update string value header card.
 
void card (const std::string &keyname, const double &value, const std::string &comment)
 Append or update double precision value header card.
 
void card (const std::string &keyname, const int &value, const std::string &comment)
 Append or update integer value header card.
 
void card (const std::string &keyname, const bool &value, const std::string &comment)
 Append or update boolean value header card.
 
void card (const std::string &keyname, const char *value, const std::string &comment)
 Append or update character value header card.
 
std::string string (const std::string &keyname) const
 Return card value as string.
 
double real (const std::string &keyname) const
 Return card value as double precision.
 
int integer (const std::string &keyname) const
 Return card value as integer.
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor.
 

Private Member Functions

void init_members (void)
 Initialise class members.
 
void copy_members (const GFitsBinTable &table)
 Copy class members.
 
void free_members (void)
 Delete class members.
 
void init_table_header (void)
 Initialise binary table header.
 

Additional Inherited Members

- Public Types inherited from GFitsHDU
enum  HDUType { HT_IMAGE = 0 , HT_ASCII_TABLE = 1 , HT_BIN_TABLE = 2 }
 
- Protected Member Functions inherited from GFitsTable
void init_members (void)
 Initialise class members.
 
void copy_members (const GFitsTable &table)
 Copy class members.
 
void free_members (void)
 Free class members.
 
void free_columns (void)
 Free column pointers.
 
void update_header (void)
 Update header after row or column manipulations.
 
void data_open (void *vptr)
 Open Table.
 
void data_save (void)
 Save table into FITS file.
 
void data_close (void)
 Close table.
 
void data_connect (void *vptr)
 Connect table data to FITS file.
 
char * get_ttype (const int &colnum) const
 Returns pointer to column type.
 
char * get_tform (const int &colnum) const
 Returns pointer to column format.
 
char * get_tunit (const int &colnum) const
 Returns pointer to column unit.
 
- Protected Member Functions inherited from GFitsHDU
void init_members (void)
 Initialise class members.
 
void copy_members (const GFitsHDU &hdu)
 Copy class members.
 
void free_members (void)
 Delete class members.
 
void connect (void *fptr)
 Connect HDU to FITS file.
 
void move_to_hdu (void)
 Move FITS file pointer to HDU.
 
HDUType get_hdu_type (void) const
 Get HDU type from FITS file.
 
void open (void *vptr, int hdunum)
 Open HDU.
 
void save (void)
 Saves HDU.
 
std::string print_hdu (const GChatter &chatter=NORMAL) const
 Print basic HDU information.
 
std::string typecode (int type) const
 Return typecode as string.
 
- Protected Attributes inherited from GFitsTable
int m_type
 Table type (1=ASCII, 2=Binary)
 
int m_rows
 Number of rows in table.
 
int m_cols
 Number of columns in table.
 
GFitsTableCol ** m_columns
 Array of table columns.
 
- Protected Attributes inherited from GFitsHDU
void * m_fitsfile
 FITS file pointer pointing on actual HDU.
 
int m_hdunum
 HDU number (starting from 0)
 
std::string m_name
 HDU name (extname)
 
GFitsHeader m_header
 HDU header.
 

Detailed Description

FITS binary table class.

Definition at line 39 of file GFitsBinTable.hpp.

Constructor & Destructor Documentation

◆ GFitsBinTable() [1/3]

GFitsBinTable::GFitsBinTable ( void )

Void constructor.

Definition at line 53 of file GFitsBinTable.cpp.

References init_members().

Referenced by clone().

◆ GFitsBinTable() [2/3]

GFitsBinTable::GFitsBinTable ( const int & nrows)
explicit

Table constructor.

Parameters
[in]nrowsNumber of rows in table

Definition at line 68 of file GFitsBinTable.cpp.

References init_members(), and init_table_header().

◆ GFitsBinTable() [3/3]

GFitsBinTable::GFitsBinTable ( const GFitsBinTable & table)

Copy constructor.

Parameters
[in]tableBinary table.

Definition at line 86 of file GFitsBinTable.cpp.

References copy_members(), and init_members().

◆ ~GFitsBinTable()

GFitsBinTable::~GFitsBinTable ( void )
virtual

Destructor.

Definition at line 102 of file GFitsBinTable.cpp.

References free_members().

Member Function Documentation

◆ classname()

std::string GFitsBinTable::classname ( void ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GFitsBinTable").

Implements GFitsTable.

Definition at line 72 of file GFitsBinTable.hpp.

◆ clear()

void GFitsBinTable::clear ( void )
virtual

Clear binary table.

This method properly resets the object to an initial state.

Implements GFitsTable.

Definition at line 159 of file GFitsBinTable.cpp.

References free_members(), GFitsHDU::free_members(), GFitsTable::free_members(), init_members(), GFitsHDU::init_members(), and GFitsTable::init_members().

◆ clone()

GFitsBinTable * GFitsBinTable::clone ( void ) const
virtual

Clone binary table.

Returns
Pointer to deep copy of binary table.

Implements GFitsTable.

Definition at line 181 of file GFitsBinTable.cpp.

References GFitsBinTable().

◆ copy_members()

void GFitsBinTable::copy_members ( const GFitsBinTable & table)
private

Copy class members.

Parameters
[in]tableTable to copy

Definition at line 211 of file GFitsBinTable.cpp.

Referenced by GFitsBinTable(), and operator=().

◆ exttype()

GFitsHDU::HDUType GFitsBinTable::exttype ( void ) const
inlinevirtual

Return extension type.

Returns
Extension type (HT_BIN_TABLE).

Implements GFitsTable.

Definition at line 84 of file GFitsBinTable.hpp.

References GFitsHDU::HT_BIN_TABLE.

◆ free_members()

void GFitsBinTable::free_members ( void )
private

Delete class members.

Definition at line 221 of file GFitsBinTable.cpp.

Referenced by clear(), operator=(), and ~GFitsBinTable().

◆ init_members()

void GFitsBinTable::init_members ( void )
private

Initialise class members.

Definition at line 196 of file GFitsBinTable.cpp.

References GFitsTable::m_type.

Referenced by clear(), GFitsBinTable(), GFitsBinTable(), GFitsBinTable(), and operator=().

◆ init_table_header()

void GFitsBinTable::init_table_header ( void )
private

Initialise binary table header.

Initialises the table header by setting the default header cards.

Definition at line 233 of file GFitsBinTable.cpp.

References GFitsHeader::append(), GFitsTable::m_columns, GFitsHDU::m_header, GFitsTable::ncols(), GFitsTable::nrows(), and GFitsTableCol::width().

Referenced by GFitsBinTable().

◆ operator=()

GFitsBinTable & GFitsBinTable::operator= ( const GFitsBinTable & table)

Assignment operator.

Parameters
[in]tableBinary table.
Returns
Binary table.

Definition at line 124 of file GFitsBinTable.cpp.

References copy_members(), free_members(), init_members(), and GFitsTable::operator=().


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