casa
5.7.0-16
|
Definition of a Measure column in a Table. More...
#include <TableMeasDesc.h>
Public Member Functions | |
TableMeasDesc (const TableMeasValueDesc &) | |
Constructor with measure value descriptor. More... | |
TableMeasDesc (const TableMeasValueDesc &, const Vector< Unit > &) | |
Constructor with measure value descriptor and Vector of Units. More... | |
TableMeasDesc (const TableMeasValueDesc &, const TableMeasRefDesc &) | |
Constructor with value and reference descriptors. More... | |
TableMeasDesc (const TableMeasValueDesc &, const TableMeasRefDesc &, const Vector< Unit > &) | |
Constructor with value and reference descriptors and Vector of Units. More... | |
virtual TableMeasDescBase * | clone () const |
Clone the object. More... | |
TableMeasDesc (const TableMeasDesc< M > &that) | |
Copy constructor (copy semantics). More... | |
~TableMeasDesc () | |
TableMeasDesc< M > & | operator= (const TableMeasDesc< M > &that) |
Assignment operator (copy semantics) More... | |
Public Member Functions inherited from casacore::TableMeasDescBase | |
TableMeasDescBase () | |
Null constructor. More... | |
TableMeasDescBase (const TableMeasValueDesc &, const TableMeasRefDesc &) | |
Constructor with value and reference descriptors. More... | |
TableMeasDescBase (const TableMeasDescBase &that) | |
Copy constructor. More... | |
virtual | ~TableMeasDescBase () |
TableMeasDescBase & | operator= (const TableMeasDescBase &that) |
Assignment operator. More... | |
void | write (TableDesc &) |
Makes the descriptor persistent. More... | |
void | write (Table &) |
void | writeIfOld (const Table &) |
Make the descriptor persistent if there was no refcode vector. More... | |
const String & | columnName () const |
Get the name of the underlying column. More... | |
uInt | getRefCode () const |
Return the reference code. More... | |
Bool | isRefCodeVariable () const |
Returns True if the reference varies per row. More... | |
const String & | refColumnName () const |
Returns the name of the ref code column when the ref code is variable. More... | |
const TableMeasRefDesc & | getRefDesc () const |
Returns a reference to its measure reference descriptor. More... | |
const String & | offsetColumnName () const |
Get the name of the offset column. More... | |
Bool | hasOffset () const |
Returns True if an offset has been defined. More... | |
Bool | isOffsetVariable () const |
Returns True if the offset is variable. More... | |
Bool | isOffsetArray () const |
Returns True if the offset is variable and is stored in an ArrayMeasColumn, i.e., offsets are stored per element. More... | |
const Measure & | getOffset () const |
Returns a reference to the offset. More... | |
const String & | type () const |
Returns the descriptors measure type as a String. More... | |
uInt | refCode (const String &refString) const |
Returns the reference code for this object given a string. More... | |
const String & | refType (uInt refCode) const |
Translates the refCode for the descriptors measure type. More... | |
const Vector< Unit > & | getUnits () const |
Return the Units of the Measure values. More... | |
void | resetRefCode (uInt refCode) |
Reset the refCode, offset, or units. More... | |
void | resetOffset (const Measure &offset) |
void | resetUnits (const Vector< Unit > &units) |
Additional Inherited Members | |
Static Public Member Functions inherited from casacore::TableMeasDescBase | |
static TableMeasDescBase * | reconstruct (const Table &tab, const String &columnName) |
Reconstructs the object for the given table and column name. More... | |
static Bool | hasMeasures (const TableColumn &column) |
Does this column contain table measures? More... | |
Protected Member Functions inherited from casacore::TableMeasDescBase | |
void | initTabRef (const MeasureHolder &measHolder) |
Set the initial reference codes and types in the table. More... | |
void | setMeasUnits (const Measure &meas, const Vector< Quantum< Double > > &val, const Vector< Unit > &units) |
Set the measure and possible units. More... | |
Definition of a Measure column in a Table.
Public interface
The TableMeasures system was created to add support for Measure columns to the Casacore Table system. Measures are not a fundamental type of the Tables system and hence cannot be represented directly. Instead a Measure column can be created with the aid of the TableMeasDesc class hierarchy. The TableMeasDesc class hierarchy creates a Measure column by associating some number of fundamental data type Table columns into a unit. The associations between these columns is represented in the column keywords of each of the columns which make up a specific Measure column.
Creating and using Measure columns is a three step process:
Defining a Measure column (that is, steps 1 and 2 above) is the more complex operation. However, for each Measure column it is a once only operation. After a Measure column has been created its subsequent use is not much different to using "ordinary" Table columns. For information on how to use a Measure column see the (RO)ScalarMeasColumns and (RO)ArrayMeasColumns classes.
The TableMeasDesc class hierarchy contains classes for defining each component of the Measures to be contained in column. A TableMeasOffsetDesc is used to specify the offset component, a TableMeasRefDesc to set up the reference code component and a TableMeasValueDesc names the column used as the main Measure column through which the Measure column is subsequently accessed.
The final step needed to create a Measure column is the creation of a TableMeasDesc object whose constructor takes a TableMeasValueDesc and (optionally) a TableMeasRefDesc. After construction the TableMeasDesc object's write() member is used to make the the Measure column persistent within the Table.
The following examples demonstrate the creation of Measure columns using the above components. Further details about each of these components is available with each class description.
All examples write the measure description into a TableDesc object, i.e. the argument used in the TableMeasDesc::write function is a TableDesc object. It is, however, also possible to write them into a Table object which is useful if measure columns are added to an already existing table (see example 2).
The following creates a MEpoch column with a fixed reference.
Same as example above, but for an already existing table.
An MEpoch column with a variable reference code with a fixed offset:
Creating the required keyword for the definition of a Measure in a Table is somewhat complicated. This class assists in that process.
Definition at line 259 of file TableMeasDesc.h.
casacore::TableMeasDesc< M >::TableMeasDesc | ( | const TableMeasValueDesc & | ) |
casacore::TableMeasDesc< M >::TableMeasDesc | ( | const TableMeasValueDesc & | , |
const Vector< Unit > & | |||
) |
casacore::TableMeasDesc< M >::TableMeasDesc | ( | const TableMeasValueDesc & | , |
const TableMeasRefDesc & | |||
) |
Constructor with value and reference descriptors.
Units for the column will be the default for Measure type.
casacore::TableMeasDesc< M >::TableMeasDesc | ( | const TableMeasValueDesc & | , |
const TableMeasRefDesc & | , | ||
const Vector< Unit > & | |||
) |
casacore::TableMeasDesc< M >::TableMeasDesc | ( | const TableMeasDesc< M > & | that | ) |
Copy constructor (copy semantics).
casacore::TableMeasDesc< M >::~TableMeasDesc | ( | ) |
|
virtual |
Clone the object.
Reimplemented from casacore::TableMeasDescBase.
TableMeasDesc<M>& casacore::TableMeasDesc< M >::operator= | ( | const TableMeasDesc< M > & | that | ) |
Assignment operator (copy semantics)