|
| ArrayMeasColumn () |
| The default constructor creates a null object. More...
|
|
| ArrayMeasColumn (const Table &tab, const String &columnName) |
| Create the ArrayMeasColumn from the table and column Name. More...
|
|
| ArrayMeasColumn (const ArrayMeasColumn< M > &that) |
| Copy constructor (copy semantics). More...
|
|
virtual | ~ArrayMeasColumn () |
|
void | reference (const ArrayMeasColumn< M > &that) |
| Change the reference to another column. More...
|
|
void | attach (const Table &tab, const String &columnName) |
| Attach a column to the object. More...
|
|
Array< M > | convert (rownr_t rownr, const M &meas) const |
| Get the Measure array contained in the specified row and convert it to the reference and offset found in the given measure. More...
|
|
Array< M > | convert (rownr_t rownr, const MeasRef< M > &measRef) const |
| Get the Measure array contained in the specified row and convert it to the given reference. More...
|
|
Array< M > | convert (rownr_t rownr, uInt refCode) const |
|
const MeasRef< M > & | getMeasRef () const |
| Get the column's reference. 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 (rownr_t rownr, Array< M > &meas, Bool resize=False) const |
| Get the Measure array in the specified row. More...
|
|
Array< M > | operator() (rownr_t rownr) const |
|
|
void | put (rownr_t rownr, const Array< M > &) |
| Add a Measure array to the specified 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 (rownr_t 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::ArrayMeasColumn< M >
Access table array Measure columns.
Intended use:
Public interface
Review Status
- Reviewed By:
- Bob Garwood
- Date Reviewed:
- 1999/12/23
- Test programs:
- tTableMeasures
Prerequisite
Synopsis
ArrayMeasColumn objects can be used to access array 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 ArrayMeasColumn class is templated on Measure type and MeasValue type but typedefs exist for making declaration less long winded. The Measure classes (like MEpoch) have typedefs ArrayColumn
to assist in creating ArrayMeasColumn objects.
Constructing array Measure column objects using these typedefs looks like this:
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.
Care needs to be taken when adding Measures to a column. The user needs to be aware that Measures are not checked for consistency, with respect to a Measure's reference, between the Measures being added to a column and the column's predefined Measure reference. This is only an issue if the Measure column was defined to have a fixed reference. For such columns the reference component of Measures added to a column is silently ignored, that is, there is no warning nor is there any sort of conversion to the column's reference should the reference of the added Measure be different from the column's reference. The functions
TableMeasDescBase::isRefVariable() and
ArrayMeasColumn::getMeasRef() can be used to discover a Measure column's Measure reference characteristics.
Example
ArrayMeasColumn<MEpoch> arrayCol;
if (arrayCol.isNull()) {
arrayCol.attach(tab, "Time1Arr");
}
arrayCol.throwIfNull();
Vector<MEpoch> ev(10);
for (
uInt i=0; i<10; i++) {
ev(i) = last;
}
if (!arrayCol.isDefined(0)) {
cout << "PASS - nothing in the measure array column row yet\n";
} else {
cout << "FAIL - there shouldn't be a valid value in the row!\n";
}
arrayCol.put(0, ev);
ArrayMeasColumn<MEpoch> roArrCol(tab, "Time1Arr");
Vector<MEpoch> ew;
arrayCol.get(0, ew, True);
Motivation
The standard Casacore Table system does not support array Measure columns. This class overcomes this limitation.
Thrown Exceptions
Definition at line 45 of file MBaseline.h.