GammaLib
2.1.0.dev
|
Abstract interface for FITS table. More...
#include <GFitsTable.hpp>
Public Member Functions | |
GFitsTable (void) | |
Void constructor. More... | |
GFitsTable (const int &nrows) | |
Table constructor. More... | |
GFitsTable (const GFitsTable &table) | |
Copy constructor. More... | |
virtual | ~GFitsTable (void) |
Destructor. More... | |
GFitsTable & | operator= (const GFitsTable &table) |
Assignment operator. More... | |
GFitsTableCol * | operator[] (const int &colnum) |
Returns pointer to table column. More... | |
const GFitsTableCol * | operator[] (const int &colnum) const |
Returns pointer to table column (const version) More... | |
GFitsTableCol * | operator[] (const std::string &colname) |
Returns pointer to table column. More... | |
const GFitsTableCol * | operator[] (const std::string &colname) const |
Returns pointer to table column (const version) More... | |
virtual void | clear (void)=0 |
Clear object. More... | |
virtual GFitsTable * | clone (void) const =0 |
Clones object. More... | |
virtual std::string | classname (void) const =0 |
Return class name. More... | |
virtual HDUType | exttype (void) const =0 |
GFitsTableCol * | set (const int &colnum, const GFitsTableCol &column) |
Set column. More... | |
GFitsTableCol * | set (const std::string &colname, const GFitsTableCol &column) |
Set column. More... | |
GFitsTableCol * | append (const GFitsTableCol &column) |
Append column to the table. More... | |
GFitsTableCol * | insert (int colnum, const GFitsTableCol &column) |
Insert column into the table. More... | |
GFitsTableCol * | insert (const std::string &colname, const GFitsTableCol &column) |
Insert column into the table. More... | |
void | remove (const int &colnum) |
Remove column from the table. More... | |
void | remove (const std::string &colname) |
Remove column from the table. More... | |
void | append_rows (const int &nrows) |
Append rows to the table. More... | |
void | insert_rows (const int &row, const int &nrows) |
Insert rows into the table. More... | |
void | remove_rows (const int &row, const int &nrows) |
Remove rows from the table. More... | |
const int & | nrows (void) const |
Return number of rows in table. More... | |
const int & | ncols (void) const |
Return number of columns in table. More... | |
bool | contains (const std::string &colname) const |
Checks the presence of a column in table. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print table information. More... | |
Public Member Functions inherited from GFitsHDU | |
GFitsHDU (void) | |
Void constructor. More... | |
GFitsHDU (const GFitsHDU &hdu) | |
Copy constructor. More... | |
virtual | ~GFitsHDU (void) |
Destructor. More... | |
GFitsHDU & | operator= (const GFitsHDU &hdu) |
Assignment operator. More... | |
int | cards (void) const |
Return number of cards in HDU header. More... | |
const std::string & | extname (void) const |
Return extension name. More... | |
void | extname (const std::string &extname) |
Set HDU extension name (EXTNAME keyword) More... | |
const int & | extno (void) const |
Return extension number. More... | |
void | extno (const int &extno) |
Set extension number. More... | |
const GFitsHeader & | header (void) const |
Return extension header. More... | |
void | header (const GFitsHeader &header) |
Set extension header. More... | |
bool | has_card (const int &cardno) const |
Check existence of header card. More... | |
bool | has_card (const std::string &keyname) const |
Checks for presence of header card. More... | |
GFitsHeaderCard & | card (const int &cardno) |
Return header card. More... | |
const GFitsHeaderCard & | card (const int &cardno) const |
Return header card (const version) More... | |
GFitsHeaderCard & | card (const std::string &keyname) |
Return header card. More... | |
const GFitsHeaderCard & | card (const std::string &keyname) const |
Return header card (const version) More... | |
void | card (const GFitsHeaderCard &card) |
Append or update header card. More... | |
void | card (const std::string &keyname, const std::string &value, const std::string &comment) |
Append or update string value header card. More... | |
void | card (const std::string &keyname, const double &value, const std::string &comment) |
Append or update double precision value header card. More... | |
void | card (const std::string &keyname, const int &value, const std::string &comment) |
Append or update integer value header card. More... | |
void | card (const std::string &keyname, const bool &value, const std::string &comment) |
Append or update boolean value header card. More... | |
void | card (const std::string &keyname, const char *value, const std::string &comment) |
Append or update character value header card. More... | |
std::string | string (const std::string &keyname) const |
Return card value as string. More... | |
double | real (const std::string &keyname) const |
Return card value as double precision. More... | |
int | integer (const std::string &keyname) const |
Return card value as integer. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
Protected Member Functions | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GFitsTable &table) |
Copy class members. More... | |
void | free_members (void) |
Free class members. More... | |
void | free_columns (void) |
Free column pointers. More... | |
void | update_header (void) |
Update header after row or column manipulations. More... | |
void | data_open (void *vptr) |
Open Table. More... | |
void | data_save (void) |
Save table into FITS file. More... | |
void | data_close (void) |
Close table. More... | |
void | data_connect (void *vptr) |
Connect table data to FITS file. More... | |
char * | get_ttype (const int &colnum) const |
Returns pointer to column type. More... | |
char * | get_tform (const int &colnum) const |
Returns pointer to column format. More... | |
char * | get_tunit (const int &colnum) const |
Returns pointer to column unit. More... | |
Protected Member Functions inherited from GFitsHDU | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GFitsHDU &hdu) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
void | connect (void *fptr) |
Connect HDU to FITS file. More... | |
void | move_to_hdu (void) |
Move FITS file pointer to HDU. More... | |
HDUType | get_hdu_type (void) const |
Get HDU type from FITS file. More... | |
void | open (void *vptr, int hdunum) |
Open HDU. More... | |
void | save (void) |
Saves HDU. More... | |
std::string | print_hdu (const GChatter &chatter=NORMAL) const |
Print basic HDU information. More... | |
std::string | typecode (int type) const |
Return typecode as string. More... | |
Protected Attributes | |
int | m_type |
Table type (1=ASCII, 2=Binary) More... | |
int | m_rows |
Number of rows in table. More... | |
int | m_cols |
Number of columns in table. More... | |
GFitsTableCol ** | m_columns |
Array of table columns. More... | |
Protected Attributes inherited from GFitsHDU | |
void * | m_fitsfile |
FITS file pointer pointing on actual HDU. More... | |
int | m_hdunum |
HDU number (starting from 0) More... | |
std::string | m_name |
HDU name (extname) More... | |
GFitsHeader | m_header |
HDU header. More... | |
Private Member Functions | |
GFitsTableCol * | alloc_column (int typecode) const |
Allocates column. More... | |
GFitsTableCol * | ptr_column (const std::string &colname) const |
Returns pointer of column with given name. More... | |
int | colnum (const std::string &colname) const |
Returns column number of a given column name. More... | |
Additional Inherited Members | |
Public Types inherited from GFitsHDU | |
enum | HDUType { HT_IMAGE = 0, HT_ASCII_TABLE = 1, HT_BIN_TABLE = 2 } |
Abstract interface for FITS table.
This class defines the abstract interface for a FITS table. A FITS table is a collection of columns with an identical number of rows. This class provides high level access to table columns.
Definition at line 44 of file GFitsTable.hpp.
GFitsTable::GFitsTable | ( | void | ) |
Void constructor.
Construct empty FITS table.
Definition at line 89 of file GFitsTable.cpp.
References init_members().
|
explicit |
Table constructor.
[in] | nrows | Number of rows in table. |
Construct FITS table with nrows
table rows.
Definition at line 106 of file GFitsTable.cpp.
References init_members(), m_rows, and nrows().
GFitsTable::GFitsTable | ( | const GFitsTable & | table | ) |
Copy constructor.
[in] | table | FITS table. |
Definition at line 124 of file GFitsTable.cpp.
References copy_members(), and init_members().
|
virtual |
|
private |
Allocates column.
[in] | typecode | cfitsio type code |
Allocates a table column depending on the cfitsio type code. If the type code is not found then return a NULL pointer.
Definition at line 1876 of file GFitsTable.cpp.
References __TBIT, __TBYTE, __TCOMPLEX, __TDBLCOMPLEX, __TDOUBLE, __TFLOAT, __TLOGICAL, __TLONG, __TLONGLONG, __TSHORT, __TSTRING, __TULONG, __TUSHORT, and abs().
Referenced by data_open().
|
inline |
Append column to the table.
[in] | column | Table column. |
Definition at line 147 of file GFitsTable.hpp.
References insert(), and m_cols.
Referenced by GModelSpectralTable::create_eng_table(), GSkyMap::create_healpix_hdu(), GModelSpectralTable::create_par_table(), GModelSpectralTable::create_spec_table(), GResponseVectorCache::save(), GObservations::likelihood::save_fits(), GCOMDris::vetorate_finish(), GLATPsfV1::write(), GLATResponseTable::write(), GLATPsfV3::write(), GCOMD1Response::write(), GCOMD2Response::write(), GCOMTim::write(), GGti::write(), GEnergies::write(), GRmf::write(), GNodeArray::write(), GArf::write(), GEbounds::write(), GCTAResponseTable::write(), GPha::write(), GLATAeff::write_aeff(), GSPIResponse::write_detids(), GLATAeff::write_efficiency(), GSPIResponse::write_energies(), GCTAEventList::write_events(), and GLATPsfBase::write_scale().
void GFitsTable::append_rows | ( | const int & | nrows | ) |
Append rows to the table.
[in] | nrows | Number of rows to be appended. |
Appends nrows
rows at the end of the FITS table. The method calls the insert() method to do the job. Note that a call of this method will lead to loading all table data into memory.
Definition at line 647 of file GFitsTable.cpp.
References insert_rows(), and nrows().
|
pure virtual |
Return class name.
Returns the class name for non-abstract classes in a human readable way.
Implements GFitsHDU.
Implemented in GFitsAsciiTable, and GFitsBinTable.
Referenced by GVOTable::read().
|
pure virtual |
Clear object.
Sets the object to a clean initial state. After calling the method the object will be in the same state as it were if an empty instance of the object would have been created.
Implements GFitsHDU.
Implemented in GFitsAsciiTable, and GFitsBinTable.
|
pure virtual |
Clones object.
Creates a deep copy of the object and returns a pointer to the object.
Implements GFitsHDU.
Implemented in GFitsAsciiTable, and GFitsBinTable.
Referenced by GCTABackground2D::read(), GCTABackground3D::read(), GLATEventCube::read_gti(), and gammalib::spi_hdu().
|
private |
Returns column number of a given column name.
[in] | colname | Name of column. |
Returns the column number of the column with the specified name. If more columns with the same name exist, the first of these columns is returned.
Definition at line 1971 of file GFitsTable.cpp.
References m_cols, and m_columns.
Referenced by data_save(), get_tform(), get_ttype(), get_tunit(), insert(), operator[](), remove(), and set().
bool GFitsTable::contains | ( | const std::string & | colname | ) | const |
Checks the presence of a column in table.
[in] | colname | Column name. |
Definition at line 759 of file GFitsTable.cpp.
References ptr_column().
Referenced by GCTAResponseIrf::load_aeff(), GCTAResponseIrf::load_background(), GCTAResponseIrf::load_edisp(), GCTAResponseIrf::load_psf(), GCTAEventList::read(), GCTAPsfVector::read(), GCOMInstChars::read_coeffs(), GRmf::write(), and GArf::write().
|
protected |
Copy class members.
[in] | table | FITS Table. |
Copies FITS table members from table
.
Definition at line 868 of file GFitsTable.cpp.
References GFitsTableCol::clone(), m_cols, m_columns, m_rows, and m_type.
Referenced by GFitsTable(), and operator=().
|
protectedvirtual |
Close table.
Implements GFitsHDU.
Definition at line 1719 of file GFitsTable.cpp.
References free_members(), and init_members().
|
protectedvirtual |
Connect table data to FITS file.
[in] | vptr | FITS file pointer. |
Connects the table columns to the file specified by the FITS file pointer. This method does nothing if the file pointer in not valid.
Implements GFitsHDU.
Definition at line 1740 of file GFitsTable.cpp.
References GFitsTableCol::connect(), m_cols, and m_columns.
|
protectedvirtual |
Open Table.
[in] | vptr | FITS file pointer. |
GException::fits_error | A CFITSIO error occured during loading the table. |
GException::runtime_error | FITS column of unsupported type has been found in the FITS file. The TDIM information provided in the header is inconsistent with the size of the column. |
This method loads a description of the table into memory. Column data are not loaded at this point to save memory. They will be loaded on request later.
Implements GFitsHDU.
Definition at line 1122 of file GFitsTable.cpp.
References __ffgkey, __ffgky, __ffgkyd, __ffgncl, __ffgnrw, __ffgtcl, __TINT, __TLONG, __TSHORT, __TSTRING, __TUINT, __TULONG, __TUSHORT, alloc_column(), GFitsTableCol::colnum(), GFitsTableCol::connect(), GFitsTableCol::dim(), gammalib::fits_move_to_hdu(), FPTR, FPTR_COPY, free_columns(), G_DATA_OPEN, GFitsTableCol::is_variable(), m_cols, m_columns, GFitsHDU::m_fitsfile, m_rows, GFitsTableCol::name(), nrows(), GFitsTableCol::nrows(), GFitsTableCol::number(), gammalib::number(), GFitsTableCol::repeat(), gammalib::split(), gammalib::str(), gammalib::strip_chars(), gammalib::strip_whitespace(), gammalib::toint(), GFitsTableCol::tscale(), GFitsTableCol::type(), GFitsHDU::typecode(), GFitsTableCol::unit(), and GFitsTableCol::width().
|
protectedvirtual |
Save table into FITS file.
GException::fits_error | A CFITSIO error occured in this method. |
GException::runtime_error | Table columns have inconsistent lengths. |
Saves the FITS table into the FITS file.
In case that no table HDU exists so far in the FITS file, a new table will be appended to the FITS file. In case that a different HDU type exists at the requested extension number, the existing HDU will be deleted and be replaced by the requested table type.
The method also verifies the consistency of all table columns. Table columns need to have identical lengths to be saved into a FITS table. All columns with a length of zero will be excluded from saving, and if they exist in the FITS file, they will be removed from the file.
Implements GFitsHDU.
Definition at line 1379 of file GFitsTable.cpp.
References __ffcrtb, __ffdcol, __ffdhdu, __ffdrow, __ffgabc, __ffgkey, __ffgncl, __ffgnrw, __ffibin, __fficol, __ffirow, __ffitab, __ffmahd, GFitsTableCol::colnum(), colnum(), exttype(), FPTR, FPTR_COPY, G_DATA_SAVE, get_tform(), get_ttype(), get_tunit(), GFitsHDU::HT_ASCII_TABLE, m_cols, m_columns, GFitsHDU::m_fitsfile, GFitsHDU::m_hdunum, m_rows, m_type, GFitsTableCol::name(), nrows(), GFitsTableCol::print(), GFitsTableCol::save(), gammalib::str(), gammalib::strip_whitespace(), and update_header().
|
pure virtual |
|
protected |
Free column pointers.
De-allocates all column pointers.
Definition at line 913 of file GFitsTable.cpp.
References m_cols, and m_columns.
Referenced by data_open(), free_members(), and remove().
|
protected |
Free class members.
Free all class members.
Definition at line 898 of file GFitsTable.cpp.
References free_columns().
Referenced by GFitsBinTable::clear(), GFitsAsciiTable::clear(), data_close(), operator=(), and ~GFitsTable().
|
protected |
Returns pointer to column format.
[in] | colnum | Column number (starting from 0). |
GException::fits_unknown_tabtype | Table is neither ASCII nor Binary. |
This methods allocates memory for the character string that holds the column format. The client has to de-allocate this memory after usage. In case that the column does not exist a NULL pointer is returned.
Definition at line 1799 of file GFitsTable.cpp.
References GFitsTableCol::ascii_format(), colnum(), G_GET_TFORM, GFitsHDU::HT_ASCII_TABLE, GFitsHDU::HT_BIN_TABLE, m_cols, m_columns, m_type, gammalib::str(), and GFitsTableCol::tform_binary().
Referenced by data_save(), and update_header().
|
protected |
Returns pointer to column type.
[in] | colnum | Column number for which type is to be returned |
This methods allocates memory for the character string that holds the column type. The client has to de-allocate this memory after usage. In case that the column does not exist a NULL pointer is returned.
Definition at line 1768 of file GFitsTable.cpp.
References colnum(), m_cols, m_columns, and GFitsTableCol::name().
Referenced by data_save(), and update_header().
|
protected |
Returns pointer to column unit.
[in] | colnum | Column number (starting from 0). |
This methods allocates memory for the character string that holds the column unit. The client has to de-allocate this memory after usage. In case that the column does not exist a NULL pointer is returned.
Definition at line 1843 of file GFitsTable.cpp.
References colnum(), m_cols, m_columns, and GFitsTableCol::unit().
Referenced by data_save(), and update_header().
|
protected |
Initialise class members.
Definition at line 848 of file GFitsTable.cpp.
References m_cols, m_columns, m_rows, and m_type.
Referenced by GFitsBinTable::clear(), GFitsAsciiTable::clear(), data_close(), GFitsTable(), and operator=().
GFitsTableCol * GFitsTable::insert | ( | int | colnum, |
const GFitsTableCol & | column | ||
) |
Insert column into the table.
[in] | colnum | Column number [0,...,ncols()]. |
[in] | column | Table column. |
GException::invalid_argument | The length of the column is incompatible with the number of rows in the table. |
A column will be inserted at position 'colnum' of the table. If the position is beyond the end of the table the column will be appended.
If the table is empty and has 0 rows, the number of rows will be set to the length of the column.
The length of the column to be inserted has to be identical to the number of rows in the table.
Definition at line 433 of file GFitsTable.cpp.
References GFitsTableCol::clone(), GFitsTableCol::colnum(), colnum(), G_INSERT1, m_cols, m_columns, m_rows, ncols(), GFitsTableCol::nrows(), gammalib::str(), and update_header().
GFitsTableCol * GFitsTable::insert | ( | const std::string & | colname, |
const GFitsTableCol & | column | ||
) |
Insert column into the table.
[in] | colname | Column name. |
[in] | column | Table column. |
GException::invalid_argument | FITS table column not found. |
Inserts the column at the position given by the specified column name.
Definition at line 523 of file GFitsTable.cpp.
void GFitsTable::insert_rows | ( | const int & | row, |
const int & | nrows | ||
) |
Insert rows into the table.
[in] | row | Row at which rows are inserted [0,...,nrows()]. |
[in] | nrows | Number of rows to be inserted. |
GException::out_of_range | Specified row is invalid. |
Inserts nrows
table rows at the specified row
into the table. If the row
index is set to the number of existing rows, nrows(), nrows
will be appened at the end of the table.
Note that this method will load all table data into memory.
Definition at line 675 of file GFitsTable.cpp.
References G_INSERT_ROWS, GFitsTableCol::insert(), m_cols, m_columns, m_rows, nrows(), and update_header().
Referenced by append_rows().
|
inline |
Return number of columns in table.
Returns the number of columns in table. This method is equivalent to the size() method.
Definition at line 134 of file GFitsTable.hpp.
References m_cols.
Referenced by GVOTable::data_from_fits_table(), GFitsBinTable::init_table_header(), GFitsAsciiTable::init_table_header(), insert(), GVOTable::read(), GCTABackground3D::read(), GCTABackground2D::read(), GArf::read(), GPha::read(), GCTAResponseTable::read_colnames(), GCTAEventList::read_events(), GMWLSpectrum::read_fits(), GSkyMap::read_healpix(), remove(), and set().
|
inline |
Return number of rows in table.
Returns the number of rows in table.
Definition at line 119 of file GFitsTable.hpp.
References m_rows.
Referenced by append_rows(), GVOTable::data_from_fits_table(), data_open(), data_save(), GApplication::gCO2e(), GFitsTable(), GFitsBinTable::init_table_header(), GFitsAsciiTable::init_table_header(), insert_rows(), GEphemerides::load(), GCOMStatus::load_status(), GCOMD1Response::read(), GCOMD2Response::read(), GCOMTim::read(), GCOMOads::read(), GResponseVectorCache::read(), GCOMBvcs::read(), GCTAEventList::read(), GCOMHkds::read(), GNodeArray::read(), GCOMInstChars::read_coeffs(), GSPIResponse::read_detids(), GSPIResponse::read_energies(), GCOMEventList::read_events(), GCTAEventList::read_events(), GMWLSpectrum::read_fits(), GSkyMap::read_healpix(), GCOMInstChars::read_pos(), GCOMInstChars::read_selfveto(), remove_rows(), GCOMDri::save(), GCaldb::size(), gammalib::spi_hdu(), and gammalib::spi_num_hdus().
GFitsTable & GFitsTable::operator= | ( | const GFitsTable & | table | ) |
Assignment operator.
[in] | table | FITS table. |
Definition at line 162 of file GFitsTable.cpp.
References copy_members(), free_members(), init_members(), and GFitsHDU::operator=().
Referenced by GFitsBinTable::operator=(), and GFitsAsciiTable::operator=().
GFitsTableCol * GFitsTable::operator[] | ( | const int & | colnum | ) |
Returns pointer to table column.
[in] | colnum | Column number [0,...,ncols()-1]. |
GException::invalid_argument | No data found in table. |
GException::out_of_range | Column number is out of range. |
GException::runtime_error | Empty FITS column pointer encountered. |
Definition at line 199 of file GFitsTable.cpp.
const GFitsTableCol * GFitsTable::operator[] | ( | const int & | colnum | ) | const |
Returns pointer to table column (const version)
[in] | colnum | Column number [0,...,ncols()-1]. |
GException::invalid_argument | No data found in table. |
GException::out_of_range | Column number is out of range. |
GException::runtime_error | Empty FITS column pointer encountered. |
Definition at line 241 of file GFitsTable.cpp.
GFitsTableCol * GFitsTable::operator[] | ( | const std::string & | colname | ) |
Returns pointer to table column.
[in] | colname | Column name. |
GException::invalid_argument | No data found in table. |
GException::invalid_argument | FITS column name not found. |
Definition at line 281 of file GFitsTable.cpp.
References G_ACCESS2, m_columns, and ptr_column().
const GFitsTableCol * GFitsTable::operator[] | ( | const std::string & | colname | ) | const |
Returns pointer to table column (const version)
[in] | colname | Column name. |
GException::invalid_argument | No data found in table. |
GException::invalid_argument | FITS column name not found. |
Definition at line 316 of file GFitsTable.cpp.
References G_ACCESS2, m_columns, and ptr_column().
Print table information.
[in] | chatter | Chattiness. |
Implements GFitsHDU.
Definition at line 775 of file GFitsTable.cpp.
References GFitsHDU::HT_ASCII_TABLE, GFitsHDU::HT_BIN_TABLE, m_cols, m_columns, GFitsHDU::m_header, m_rows, m_type, NORMAL, gammalib::parformat(), GFitsHeader::print(), GFitsHDU::print_hdu(), gammalib::reduce(), SILENT, gammalib::str(), and VERBOSE.
|
private |
Returns pointer of column with given name.
[in] | colname | Name of column. |
Returns a pointer to the column with the specified name. If more columns with the same name exist, a pointer to the first of these columns is returned. If no column with the specified name is found, a NULL pointer will be returned.
Definition at line 1942 of file GFitsTable.cpp.
References m_cols, and m_columns.
Referenced by contains(), and operator[]().
void GFitsTable::remove | ( | const int & | colnum | ) |
Remove column from the table.
[in] | colnum | Column number [0,...,ncols()-1]. |
GException::out_of_range | Column number is out of range. |
Remove the column at position colnum
from the table.
Definition at line 551 of file GFitsTable.cpp.
References GFitsTableCol::colnum(), colnum(), free_columns(), G_REMOVE1, m_cols, m_columns, ncols(), and update_header().
Referenced by GCTABackground2D::read(), and GCTABackground3D::read().
void GFitsTable::remove | ( | const std::string & | colname | ) |
Remove column from the table.
[in] | colname | Column name. |
GException::invalid_argument | FITS table column not found. |
Remove the column with name colname
from the table.
Definition at line 618 of file GFitsTable.cpp.
void GFitsTable::remove_rows | ( | const int & | row, |
const int & | nrows | ||
) |
Remove rows from the table.
[in] | row | Row from which on rows are removed [0,...,nrows()-1]. |
[in] | nrows | Number of rows to be removed. |
GException::out_of_range | Specified row is outside valid range. Specified nrows is outside valid range. |
Removes nrows
table rows from the specified row
on from the table.
Note that this method will load all column data into memory.
Definition at line 718 of file GFitsTable.cpp.
References G_REMOVE_ROWS, m_cols, m_columns, m_rows, nrows(), GFitsTableCol::remove(), and update_header().
GFitsTableCol * GFitsTable::set | ( | const int & | colnum, |
const GFitsTableCol & | column | ||
) |
Set column.
[in] | colnum | Column number [0,...,ncols()-1]. |
[in] | column | Table column. |
Sets the column of a table by making a deep copy of the column
provided.
Definition at line 356 of file GFitsTable.cpp.
References GFitsTableCol::clone(), colnum(), G_SET1, m_columns, ncols(), and update_header().
Referenced by set().
GFitsTableCol * GFitsTable::set | ( | const std::string & | colname, |
const GFitsTableCol & | column | ||
) |
Set column.
[in] | colname | Column name. |
[in] | column | Table column. |
GException::invalid_argument | FITS table column not found. |
Sets the column of a table by making a deep copy of the column
provided.
Definition at line 394 of file GFitsTable.cpp.
|
protected |
Update header after row or column manipulations.
Updates the header after row or column manipulations so that the header is kept up-to-date with the current table structure.
The following keywords are updated:
This method should be called after adding or removing table rows or columns.
Definition at line 951 of file GFitsTable.cpp.
References __TUINT, __TULONG, __TUSHORT, abs(), GFitsHDU::card(), GFitsHeader::contains(), GFitsTableCol::dim(), get_tform(), get_ttype(), get_tunit(), GFitsHDU::header(), m_cols, m_columns, m_rows, GFitsTableCol::number(), GFitsHeader::remove(), gammalib::replace_segment(), gammalib::str(), and GFitsTableCol::width().
Referenced by data_save(), insert(), insert_rows(), remove(), remove_rows(), and set().
|
protected |
Number of columns in table.
Definition at line 100 of file GFitsTable.hpp.
Referenced by append(), colnum(), copy_members(), data_connect(), data_open(), data_save(), free_columns(), get_tform(), get_ttype(), get_tunit(), init_members(), insert(), insert_rows(), ncols(), operator[](), print(), ptr_column(), remove(), remove_rows(), and update_header().
|
protected |
Array of table columns.
Definition at line 101 of file GFitsTable.hpp.
Referenced by colnum(), copy_members(), data_connect(), data_open(), data_save(), free_columns(), get_tform(), get_ttype(), get_tunit(), init_members(), GFitsBinTable::init_table_header(), GFitsAsciiTable::init_table_header(), insert(), insert_rows(), operator[](), print(), ptr_column(), remove(), remove_rows(), set(), and update_header().
|
protected |
Number of rows in table.
Definition at line 99 of file GFitsTable.hpp.
Referenced by copy_members(), data_open(), data_save(), GFitsTable(), init_members(), insert(), insert_rows(), nrows(), print(), remove_rows(), and update_header().
|
protected |
Table type (1=ASCII, 2=Binary)
Definition at line 98 of file GFitsTable.hpp.
Referenced by copy_members(), data_save(), get_tform(), GFitsBinTable::init_members(), GFitsAsciiTable::init_members(), init_members(), and print().