|
| ScalarMeasColumn () |
| The default constructor creates a null object. More...
|
|
| ScalarMeasColumn (const Table &tab, const String &columnName) |
| Create the ScalarMeasColumn from the table and column Name. More...
|
|
| ScalarMeasColumn (const ScalarMeasColumn< M > &that) |
| Copy constructor (copy semantics). More...
|
|
virtual | ~ScalarMeasColumn () |
|
void | reference (const ScalarMeasColumn< M > &that) |
| Change the reference to another column. More...
|
|
void | attach (const Table &tab, const String &columnName) |
| Attach a column to the object. More...
|
|
M | convert (uInt rownr, const M &meas) const |
| Get the Measure contained in the specified row and convert it to the reference and offset found in the given measure. More...
|
|
M | convert (uInt rownr, const MeasRef< M > &measRef) const |
| Get the Measure contained in the specified row and convert it to the given reference. More...
|
|
M | convert (uInt rownr, uInt refCode) const |
|
const MeasRef< M > & | getMeasRef () const |
| Returns the column's fixed reference or the reference of the last read Measure if references are variable. More...
|
|
void | setDescRefCode (uInt refCode, Bool tableMustBeEmpty=True) |
| Reset the refCode, offset, or units. More...
|
|
void | setDescOffset (const Measure &offset, Bool tableMustBeEmpty=True) |
|
void | setDescUnits (const Vector< Unit > &units, Bool tableMustBeEmpty=True) |
|
|
void | get (uInt rownr, M &meas) const |
| Get the Measure contained in the specified row. More...
|
|
M | operator() (uInt rownr) const |
|
|
void | put (uInt rownr, const M &meas) |
| Put a Measure into the given row. More...
|
|
Public Member Functions inherited from casacore::TableMeasColumn |
| TableMeasColumn () |
| The default constructor creates a null object. More...
|
|
| TableMeasColumn (const Table &tab, const String &columnName) |
| Create the ScalarMeasColumn from the table and column Name. More...
|
|
| TableMeasColumn (const TableMeasColumn &that) |
| Copy constructor (copy semantics). More...
|
|
virtual | ~TableMeasColumn () |
|
void | reference (const TableMeasColumn &that) |
| Change the reference to another column. More...
|
|
void | attach (const Table &tab, const String &columnName) |
| Attach another column to the object. More...
|
|
Bool | isDefined (uInt rownr) const |
| Tests if a row contains a Measure (i.e., if the row has a defined value). More...
|
|
const TableMeasDescBase & | measDesc () const |
| Get access to the TableMeasDescBase describing the column. More...
|
|
TableMeasDescBase & | measDesc () |
|
Bool | isNull () const |
| Test if the object is null. More...
|
|
void | throwIfNull () const |
| Throw an exception if the object is null. More...
|
|
const String & | columnName () const |
| Get the name of the column. More...
|
|
Table | table () const |
| Get the Table object this column belongs to. More...
|
|
Bool | isScalar () const |
| Is the column a scalar measures column? It is if the underlying column is a scalar column or an array column with a fixed 1-dimensional shape. More...
|
|
template<class M>
class casacore::ScalarMeasColumn< M >
Read only access to table scalar Measure columns.
Intended use:
Public interface
Review Status
- Reviewed By:
- Bob Garwood
- Date Reviewed:
- 1999/12/23
- Test programs:
- tTableMeasures
Prerequisite
Synopsis
ScalarMeasColumn objects can be used to access scalar Measure Columns in tables, both for reading and writing (if the table is writable).
Before a column can be accessed it must have previously been defined as a Measure column by use of the TableMeasDesc object.
The ScalarMeasColumn class is templated on Measure type. Typedefs exist in the various Measure classes (e.g. MEpoch) to make declaration less long winded. Constructing scalar Measure column objects using these typedefs looks like this:
MEpoch::ScalarMeasColumn ec(
table,
"ColumnName);
Reading and writing Measures
The reading and writing of Measures columns is very similar to reading and writing of "ordinary" Table columns. get() and operator() exist for reading Measures and the put() member for adding Measures to a column. (put() is obviously not defined for ScalarMeasColumn objects.) Each of these members accepts a row number as an argument. The get() function gets the measure with the reference and offset as it is stored in the column. Furthermore the convert() function is available to get the measure with the given reference, possible offset, and possible frame
When a Measure is put, the reference and possible offset are converted if the measure column is defined with a fixed reference and/or offset. If the column's reference and offset are variable, the reference and offset of the measure as put are written into the appropriate reference and offset columns.
Example
MEpoch::ScalarMeasColumn timeCol(tab, "Time1");
if (timeCol.measDesc().isRefCodeVariable()) {
cout << "The column has variable references." << endl;
} else {
cout << "The fixed MeasRef for the column is: "
<< timeCol.getMeasRef() << endl;
}
for (
uInt i=0; i<tab.nrow(); i++) {
timeCol.put(i, tm);
}
MEpoch::ScalarMeasColumn timeColRead(tab, "Time1");
for (i=0; i<tab.nrow(); i++) {
cout << timeColRead(i) << endl;
}
Motivation
The standard Casacore Table system does not support Measures columns. This class overcomes this limitation.
Thrown Exceptions
-
AipsError during construction if the column specified variable offsets which are stored in an Array- rather than a ScalarColumn.
Definition at line 45 of file MDirection.h.