CCfits  2.4
Public Member Functions | Protected Member Functions
CCfits::BinTable Class Reference

Class Representing Binary Table Extensions. Contains columns with scalar or vector row entries. More...

#include <BinTable.h>

Inheritance diagram for CCfits::BinTable:
Inheritance diagram CCfits::Table CCfits::ExtHDU CCfits::HDU

List of all members.

Public Member Functions

virtual void addColumn (ValueType type, const String &columnName, long repeatWidth, const String &colUnit=String(""), long decimals=0, size_t columnNumber=0)
 add a new column to an existing table HDU.
virtual BinTableclone (FITSBase *p) const
 virtual copy constructor
virtual void readData (bool readFlag=false, const std::vector< String > &keys=std::vector< String >())
 read columns and keys specified in the input array.

Protected Member Functions

 BinTable (FITSBase *p, const String &hduName=String(""), bool readFlag=false, const std::vector< String > &keys=std::vector< String >(), int version=1)
 reading constructor.
 BinTable (FITSBase *p, const String &hduName, int rows, const std::vector< String > &columnName=std::vector< String >(), const std::vector< String > &columnFmt=std::vector< String >(), const std::vector< String > &columnUnit=std::vector< String >(), int version=1)
 writing constructor
 BinTable (FITSBase *p, int number)
 read BinTable with HDU number number from existing file represented by fitsfile pointer p.
 ~BinTable ()
 destructor.

Detailed Description

Class Representing Binary Table Extensions. Contains columns with scalar or vector row entries.

BinTable (re)implements functions prescribed in the Table abstract class. The implementations allow the calling of cfitsio specialized routines for BinTable header construction. functions particular to the BinTable class include those dealing with variable width columns

Direct instantiation of BinTable objects is disallowed: they are created by explicit calls to FITS::addTable( ... ), FITS::read(...) or internally by one of the FITS ctors on initialization. For addTable, creation of BinTables is the default.


Constructor & Destructor Documentation

CCfits::BinTable::BinTable ( FITSBase *  p,
const String &  hduName = String(""),
bool  readFlag = false,
const std::vector< String > &  keys = std::vector<String>(),
int  version = 1 
) [protected]

reading constructor.

Construct a BinTable extension from an extension of an existing disk file. The Table is specified by name and optional version number within the file. An array of strings representing columns or keys indicates which data are to be read. The column data are only read if readFlag is true. Reading on construction is optimized, so it is more efficient to read data at the point of instantiation. This favours a "resource acquisition is initialization" model of data management.

Parameters:
pPointer to FITSBase class, an internal implementation detail
hduNamename of BinTable object to be read.
readFlagflag to determine whether to read data on construction
keys(optional) a list of keywords/columns to be read. The implementation will determine which are keywords. If none are specified, the constructor will simply read the header
version(optional) version number. If not specified, will read the first extension that matches hduName.
CCfits::BinTable::BinTable ( FITSBase *  p,
const String &  hduName,
int  rows,
const std::vector< String > &  columnName = std::vector<String>(),
const std::vector< String > &  columnFmt = std::vector<String>(),
const std::vector< String > &  columnUnit = std::vector<String>(),
int  version = 1 
) [protected]

writing constructor

The constructor creates a valid HDU which is ready for Column::write or insertRows operations. The disk FITS file is update accordingly. The data type of each column is determined by the columnFmt argument (TFORM keywords). See cfitsio documentation for acceptable values.

Parameters:
pPointer to FITSBase class, an internal implementation detail
hduNamename of BinTable object to be written
rowsnumber of rows in the table (NAXIS2)
columnNamearray of column names for columns to be constructed.
columnFmtarray of column formats for columns to be constructed.
columnUnit(optional) array of units for data in columns.
version(optional) version number for HDU.

The dimensions of columnType, columnName and columnFmt must match, but this is not enforced.


Member Function Documentation

void CCfits::BinTable::addColumn ( ValueType  type,
const String &  columnName,
long  repeatWidth,
const String &  colUnit = String(""),
long  decimals = 0,
size_t  columnNumber = 0 
) [virtual]

add a new column to an existing table HDU.

Parameters:
typeThe data type of the column to be added
columnNameThe name of the column to be added
repeatWidthfor a string valued, this is the width of a string. For a numeric column it supplies the vector length of the rows. It is ignored for ascii table numeric data.
colUnitan optional field specifying the units of the data (TUNITn)
decimalsoptional parameter specifying the number of decimals for an ascii numeric column
columnNumberoptional parameter specifying column number to be created. If not specified the column is added to the end. If specified, the column is inserted and the columns already read are reindexed. This parameter is provided as a convenience to support existing code rather than recommended.

Reimplemented from CCfits::ExtHDU.

void CCfits::BinTable::readData ( bool  readFlag = false,
const std::vector< String > &  keys = std::vector<String>() 
) [virtual]

read columns and keys specified in the input array.

See Table class documentation for further details.

Implements CCfits::ExtHDU.


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