BinaryTable is used to translate a FITS binary table to a Casacore Table. More...
#include <BinTable.h>
Public Member Functions | |
BinaryTable (FitsInput &, FITSErrorHandler errhandler=FITSError::defaultHandler, Bool useMiriadSM=False, Bool sdfits=False) | |
The only constructor is from a FitsInput, you can also optionally provide a FITS error handler. | |
~BinaryTable () | |
Table | fullTable (const String &tabName, const Table::TableOption=Table::NewNoReplace, Bool useMiriadSM=False) |
Get the full table, using the supplied arguments to construct the table. | |
Table | fullTable () |
This version of the fullTable return a Memory based table Its recommended if its being used as a temporary. | |
const TableDesc & | getDescriptor () |
Get an appropriate TableDesc (this is the same TableDesc used to construct any Table objects returned by this class. | |
TableRecord & | getKeywords () |
Return the Table keywords (this is the same TableRecord used in any Table objects returned by this class. | |
const Table & | thisRow () |
Get a Table with a single row, the current row of the FITS table. | |
const Table & | nextRow () |
Get a Table with a single row, the next row of the FITS table. | |
Private Member Functions | |
void | fillRow () |
this is the function that fills each row in as needed | |
Private Attributes | |
Table * | currRowTab |
This is the Scratch table containing the current row. | |
Int * | nelem |
The number of elements for each column of the BinaryTableExtension. | |
SimpleOrderedMap< Int, String > * | colNames |
This is a map from column number to column name. | |
TableRecord | kwSet |
FITS::ValueType * | vatypes_p |
These are used by any VADesc columns. | |
void ** | vaptr_p |
VADescFitsField * | va_p |
char * | theheap_p |
BinaryTable is used to translate a FITS binary table to a Casacore Table.
Public interface
BinaryTable inherits from the FITS BinaryTableExtension class and its primary use is to convert that class to a Casacore Table. This explains it's use but not its name. A better name should be found.
The class starts with an already existing FitsInput object, which should be set at a BinaryTableExtension HDU. Member functions provide a TableDesc appropriate for the FITS data (to help in constructing a Casacore Table compatible with the BinaryTableExtension), a Table containing the current row of FITS data and a Table containing the next row of FITS data (which can be used to step through the FitsInput, copying each row using the RowCopier class), and a Table containin the entire FITS binary table from the current row to the end of the table.
We need a way to get FITS data into Casacore Tables.
open a FitsInput from a disk file, if the HDU is a BinaryTableExtension, then instantiate a BinTable object and get the entire table. A fair amount of error checking has been eliminated from this example.
FitsInput infits("myFITSFile", FITS::Disk); switch (infits.hdutype()) { case FITS::BinaryTableHDU: BinaryTable bintab(infits); Table tab = bintable.fullTable("myTable"); break; }
There would obviously be other cases to the switch to deal with any other HDUs (e.g. skip them via infits.skip_hdu()). The Table destructor would write "myTable" to disk.
Definition at line 110 of file BinTable.h.
casacore::BinaryTable::BinaryTable | ( | FitsInput & | , | |
FITSErrorHandler | errhandler = FITSError::defaultHandler , |
|||
Bool | useMiriadSM = False , |
|||
Bool | sdfits = False | |||
) |
The only constructor is from a FitsInput, you can also optionally provide a FITS error handler.
If useMiriadSM is True, use the Miriad storage manager for all columns, otherwise AipsIO. If sdfits is True, all non-reserved and some reserved keyword are treated as if they were columns with constant values "virtual columns" in the sdfits convention.
casacore::BinaryTable::~BinaryTable | ( | ) |
void casacore::BinaryTable::fillRow | ( | ) | [private] |
this is the function that fills each row in as needed
Table casacore::BinaryTable::fullTable | ( | ) |
This version of the fullTable return a Memory based table Its recommended if its being used as a temporary.
Table casacore::BinaryTable::fullTable | ( | const String & | tabName, | |
const Table::TableOption | = Table::NewNoReplace , |
|||
Bool | useMiriadSM = False | |||
) |
const TableDesc& casacore::BinaryTable::getDescriptor | ( | ) |
TableRecord& casacore::BinaryTable::getKeywords | ( | ) |
Return the Table keywords (this is the same TableRecord used in any Table objects returned by this class.
const Table& casacore::BinaryTable::nextRow | ( | ) |
const Table& casacore::BinaryTable::thisRow | ( | ) |
Get a Table with a single row, the current row of the FITS table.
The returned Table is a Scratch table. The standard BinaryTableExtension manipulation functions are available to position the FITS input at the desired location.
SimpleOrderedMap<Int, String>* casacore::BinaryTable::colNames [private] |
This is a map from column number to column name.
Definition at line 168 of file BinTable.h.
Table* casacore::BinaryTable::currRowTab [private] |
This is the Scratch table containing the current row.
Definition at line 164 of file BinTable.h.
TableRecord casacore::BinaryTable::kwSet [private] |
Definition at line 170 of file BinTable.h.
Int* casacore::BinaryTable::nelem [private] |
The number of elements for each column of the BinaryTableExtension.
Definition at line 166 of file BinTable.h.
char* casacore::BinaryTable::theheap_p [private] |
Definition at line 176 of file BinTable.h.
VADescFitsField* casacore::BinaryTable::va_p [private] |
Definition at line 175 of file BinTable.h.
void** casacore::BinaryTable::vaptr_p [private] |
Definition at line 174 of file BinTable.h.
FITS::ValueType* casacore::BinaryTable::vatypes_p [private] |
These are used by any VADesc columns.
Definition at line 173 of file BinTable.h.