A Table intended to hold astronomical data. More...
#include <MSTable.h>
Public Member Functions | |
Bool | validate () const |
validate self (make sure that this MS is valid) | |
void | removeColumn (const String &columnName) |
Remove a column from a table No exception is thrown if this invalidates the table in order to permit more complex operations with invalid intermediate states. | |
void | removeColumn (const Vector< String > &columnNames) |
Remove columns from a table. | |
void | renameColumn (const String &newName, const String &oldName) |
Rename a column No exception is thrown if this invalidates the table in order to permit more complex operations with invalid intermediate states. | |
Static Public Member Functions | |
static Bool | validate (const TableDesc &tabDesc) |
tableDesc convenience functions | |
static Bool | validate (const TableRecord &tabKeySet) |
check that the keyword set is valid | |
static const TableDesc & | requiredTableDesc () |
return the required table description | |
static void | addColumnCompression (TableDesc &td, ColEnum which, Bool autoScale=True, const String &type=String()) |
Add the compress option for the given column to the TableDesc. | |
Protected Member Functions | |
~MSTable () | |
MSTable & | operator= (const MSTable< ColEnum, KeyEnum > &) |
Assignment operator, reference semantics. | |
Table | referenceCopy (const String &newTableName, const Block< String > &writableColumns) const |
Return a table that references all columns in this table except for those given in writableColumns, those are empty and writable. | |
Static Protected Member Functions | |
static void | colMapDef (ColEnum col, const String &colName, DataType colType, const String &colComment, const String &colUnit="", const String &colMeasureType="") |
Define an entry in the column maps. | |
static void | keyMapDef (KeyEnum key, const String &keyName, DataType keyType, const String &keyComment) |
Define an entry in the keyword maps. | |
Static Protected Attributes | |
static SimpleOrderedMap< Int, String > | columnMap_p |
These are the static ordered maps which contain the above info ColEnum -> name. | |
static SimpleOrderedMap< Int, Int > | colDTypeMap_p |
ColEnum -> DataType. | |
static SimpleOrderedMap< Int, String > | colCommentMap_p |
ColEnum -> comment string. | |
static SimpleOrderedMap< Int, String > | colUnitMap_p |
ColEnum -> UNIT string. | |
static SimpleOrderedMap< Int, String > | colMeasureTypeMap_p |
ColEnum -> MEASURE_TYPE string. | |
static SimpleOrderedMap< Int, String > | keywordMap_p |
KeyEnum -> name. | |
static SimpleOrderedMap< Int, Int > | keyDTypeMap_p |
KeyEnum -> DataType. | |
static SimpleOrderedMap< Int, String > | keyCommentMap_p |
KeyEnum -> comment string. | |
static CountedPtr< TableDesc > | requiredTD_p |
The required TableDesc. | |
| |
Bool | isColumn (ColEnum which) const |
ColEnum convenience functions. | |
Bool | isColumnWritable (ColEnum which) const |
check to see if a column is writable | |
Bool | isColumnWritable (const String &columnName) const |
Test if the given column is writable. | |
Bool | isColumnWritable (uInt columnIndex) const |
Bool | isScalar (ColEnum which) const |
Information about scalar vs array of a column. | |
Bool | isArray (ColEnum which) const |
const String & | unit (const String &which) const |
Return the UNIT keyword value associated with the specified column. | |
const String & | unit (ColEnum which) const |
Bool | isKeyword (KeyEnum which) const |
check to see if a keyword exists | |
static const String & | columnName (ColEnum which) |
Convert a ColEnum to the actual column name. | |
static ColEnum | columnType (const String &name) |
Convert a name to a ColEnum. | |
static DataType | columnDataType (ColEnum which) |
return the data type for a given ColEnum | |
static const String & | columnStandardComment (ColEnum which) |
return the standard comment for a given ColEnum | |
static const String & | columnUnit (ColEnum which) |
return the UNIT string for a given ColEnum | |
static const String & | columnMeasureType (ColEnum which) |
return the MEASURE_TYPE string for a given ColEnum | |
static void | addColumnToDesc (TableDesc &tabDesc, ColEnum which, Int ndim=-1, const String &refCol="") |
add a column to a TableDesc An exception is thrown for an invalid data type. | |
static void | addColumnToDesc (TableDesc &tabDesc, ColEnum which, const IPosition &shape, ColumnDesc::Option option, const String &refCol="") |
add a column to a TableDesc, defining the shape and setting the ColumnDesc option (Fixed, Undefined, Direct) For Measure columns you can define a variable reference column. | |
static const String & | keywordName (KeyEnum which) |
KeyEnum convenience functions. | |
static KeyEnum | keywordType (const String &name) |
static DataType | keywordDataType (KeyEnum which) |
static const String & | keywordStandardComment (KeyEnum which) |
static void | addKeyToDesc (TableDesc &tabDesc, KeyEnum key) |
add a keyword to a TableDesc An exception is thrown for an invalid data type. | |
MSTable () | |
These constructors mirror the Table ones. | |
MSTable (const String &tableName, TableOption option) | |
MSTable (const String &tableName, const TableLock &lockOptions, TableOption option) | |
MSTable (const String &tableName, const String &tableDescName, TableOption option) | |
MSTable (const String &tableName, const String &tableDescName, const TableLock &lockOptions, TableOption option) | |
MSTable (SetupNewTable &newTab, uInt nrrow, Bool initialize) | |
MSTable (SetupNewTable &newTab, const TableLock &lockOptions, uInt nrrow, Bool initialize) | |
MSTable (const Table &table) | |
MSTable (const MSTable< ColEnum, KeyEnum > &other) |
A Table intended to hold astronomical data.
Public interface
The MSTable is the base class for all MeasurementSet Tables, hence the name.
A MSTable is a Table. Most operations on a MSTable are Table operations. See the Tables module for a list of those operations. The member functions provided by this class are primarily convenience functions to help users follow the agreed upon column and keyword naming conventions. They are useful when creating a Table following the MSTable conventions from scratch as well as when creating the column objects to access those columns. All actual MeasurementSet Tables will be derived from this class.
The standard way of accessing table columns is through Strings. Mistakes in typing the column name will not be caught at compile time (and may not be caught at run time). We have therefore decided to use an enumeration to specify columns so that many mistakes will be caught at compile time. This requires functions to map to and from this enumeration to the strings that are ultimately used.
Upon destruction, the table is checked to see that all required columns and keywords are still present. If not an exception is thrown. (Not a good idea!) Nevertheless, the table will be flushed to disk if it is writable - preserving its state.
For examples of use, see the MeasurementSet class.
The Table module is more than adequate as a container of data. However, in order for applications to be useful with data from different sources, some conventions need to be adopted in the use of Tables to store data. The MSTable provides the framework for these conventions and conversion functions. The actual definitions of columns and keywords are found in the derived classes and their "enum" base class (e.g. MSAntenna and MSAntennaEnums).
Definition at line 112 of file MSTable.h.
casacore::MSTable< ColEnum, KeyEnum >::MSTable | ( | ) | [protected] |
casacore::MSTable< ColEnum, KeyEnum >::MSTable | ( | const String & | tableName, | |
TableOption | option | |||
) | [protected] |
casacore::MSTable< ColEnum, KeyEnum >::MSTable | ( | const String & | tableName, | |
const TableLock & | lockOptions, | |||
TableOption | option | |||
) | [protected] |
casacore::MSTable< ColEnum, KeyEnum >::MSTable | ( | const String & | tableName, | |
const String & | tableDescName, | |||
TableOption | option | |||
) | [protected] |
casacore::MSTable< ColEnum, KeyEnum >::MSTable | ( | const String & | tableName, | |
const String & | tableDescName, | |||
const TableLock & | lockOptions, | |||
TableOption | option | |||
) | [protected] |
casacore::MSTable< ColEnum, KeyEnum >::MSTable | ( | SetupNewTable & | newTab, | |
uInt | nrrow, | |||
Bool | initialize | |||
) | [protected] |
casacore::MSTable< ColEnum, KeyEnum >::MSTable | ( | SetupNewTable & | newTab, | |
const TableLock & | lockOptions, | |||
uInt | nrrow, | |||
Bool | initialize | |||
) | [protected] |
casacore::MSTable< ColEnum, KeyEnum >::MSTable | ( | const Table & | table | ) | [protected] |
casacore::MSTable< ColEnum, KeyEnum >::MSTable | ( | const MSTable< ColEnum, KeyEnum > & | other | ) | [protected] |
casacore::MSTable< ColEnum, KeyEnum >::~MSTable | ( | ) | [protected] |
static void casacore::MSTable< ColEnum, KeyEnum >::addColumnCompression | ( | TableDesc & | td, | |
ColEnum | which, | |||
Bool | autoScale = True , |
|||
const String & | type = String() | |||
) | [static] |
Add the compress option for the given column to the TableDesc.
It can only be used for a Float or a Complex column. For complex columns the type determines which CompressComplex engine is used. "SD" means that CompressComplexSD is used; otherwise CompressComplex is used.
static void casacore::MSTable< ColEnum, KeyEnum >::addColumnToDesc | ( | TableDesc & | tabDesc, | |
ColEnum | which, | |||
const IPosition & | shape, | |||
ColumnDesc::Option | option, | |||
const String & | refCol = "" | |||
) | [static] |
add a column to a TableDesc, defining the shape and setting the ColumnDesc option (Fixed, Undefined, Direct) For Measure columns you can define a variable reference column.
static void casacore::MSTable< ColEnum, KeyEnum >::addColumnToDesc | ( | TableDesc & | tabDesc, | |
ColEnum | which, | |||
Int | ndim = -1 , |
|||
const String & | refCol = "" | |||
) | [static] |
static void casacore::MSTable< ColEnum, KeyEnum >::addKeyToDesc | ( | TableDesc & | tabDesc, | |
KeyEnum | key | |||
) | [static] |
static void casacore::MSTable< ColEnum, KeyEnum >::colMapDef | ( | ColEnum | col, | |
const String & | colName, | |||
DataType | colType, | |||
const String & | colComment, | |||
const String & | colUnit = "" , |
|||
const String & | colMeasureType = "" | |||
) | [static, protected] |
Define an entry in the column maps.
static DataType casacore::MSTable< ColEnum, KeyEnum >::columnDataType | ( | ColEnum | which | ) | [static] |
return the data type for a given ColEnum
static const String& casacore::MSTable< ColEnum, KeyEnum >::columnMeasureType | ( | ColEnum | which | ) | [static] |
return the MEASURE_TYPE string for a given ColEnum
static const String& casacore::MSTable< ColEnum, KeyEnum >::columnName | ( | ColEnum | which | ) | [static] |
Convert a ColEnum to the actual column name.
Referenced by casacore::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::unit().
static const String& casacore::MSTable< ColEnum, KeyEnum >::columnStandardComment | ( | ColEnum | which | ) | [static] |
return the standard comment for a given ColEnum
static ColEnum casacore::MSTable< ColEnum, KeyEnum >::columnType | ( | const String & | name | ) | [static] |
Convert a name to a ColEnum.
static const String& casacore::MSTable< ColEnum, KeyEnum >::columnUnit | ( | ColEnum | which | ) | [static] |
return the UNIT string for a given ColEnum
Bool casacore::MSTable< ColEnum, KeyEnum >::isArray | ( | ColEnum | which | ) | const |
Bool casacore::MSTable< ColEnum, KeyEnum >::isColumn | ( | ColEnum | which | ) | const |
Bool casacore::MSTable< ColEnum, KeyEnum >::isColumnWritable | ( | uInt | columnIndex | ) | const [inline] |
Reimplemented from casacore::Table.
Bool casacore::MSTable< ColEnum, KeyEnum >::isColumnWritable | ( | const String & | columnName | ) | const [inline] |
Test if the given column is writable.
Reimplemented from casacore::Table.
Bool casacore::MSTable< ColEnum, KeyEnum >::isColumnWritable | ( | ColEnum | which | ) | const |
check to see if a column is writable
Referenced by casacore::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::isColumnWritable().
Bool casacore::MSTable< ColEnum, KeyEnum >::isKeyword | ( | KeyEnum | which | ) | const |
check to see if a keyword exists
Bool casacore::MSTable< ColEnum, KeyEnum >::isScalar | ( | ColEnum | which | ) | const |
Information about scalar vs array of a column.
static void casacore::MSTable< ColEnum, KeyEnum >::keyMapDef | ( | KeyEnum | key, | |
const String & | keyName, | |||
DataType | keyType, | |||
const String & | keyComment | |||
) | [static, protected] |
Define an entry in the keyword maps.
static DataType casacore::MSTable< ColEnum, KeyEnum >::keywordDataType | ( | KeyEnum | which | ) | [static] |
static const String& casacore::MSTable< ColEnum, KeyEnum >::keywordName | ( | KeyEnum | which | ) | [static] |
static const String& casacore::MSTable< ColEnum, KeyEnum >::keywordStandardComment | ( | KeyEnum | which | ) | [static] |
static KeyEnum casacore::MSTable< ColEnum, KeyEnum >::keywordType | ( | const String & | name | ) | [static] |
MSTable& casacore::MSTable< ColEnum, KeyEnum >::operator= | ( | const MSTable< ColEnum, KeyEnum > & | ) | [protected] |
Assignment operator, reference semantics.
Reimplemented from casacore::Table.
Table casacore::MSTable< ColEnum, KeyEnum >::referenceCopy | ( | const String & | newTableName, | |
const Block< String > & | writableColumns | |||
) | const [protected] |
Return a table that references all columns in this table except for those given in writableColumns, those are empty and writable.
Reimplemented in casacore::MeasurementSet, casacore::MSAntenna, casacore::MSDataDescription, casacore::MSDoppler, casacore::MSFeed, casacore::MSField, casacore::MSFlagCmd, casacore::MSFreqOffset, casacore::MSHistory, casacore::MSObservation, casacore::MSPointing, casacore::MSPolarization, casacore::MSProcessor, casacore::MSSource, casacore::MSSpectralWindow, casacore::MSState, casacore::MSSysCal, and casacore::MSWeather.
void casacore::MSTable< ColEnum, KeyEnum >::removeColumn | ( | const Vector< String > & | columnNames | ) | [inline] |
Remove columns from a table.
Reimplemented from casacore::Table.
void casacore::MSTable< ColEnum, KeyEnum >::removeColumn | ( | const String & | columnName | ) | [inline] |
Remove a column from a table No exception is thrown if this invalidates the table in order to permit more complex operations with invalid intermediate states.
Reimplemented from casacore::Table.
Definition at line 225 of file MSTable.h.
Referenced by casacore::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::removeColumn().
void casacore::MSTable< ColEnum, KeyEnum >::renameColumn | ( | const String & | newName, | |
const String & | oldName | |||
) | [inline] |
Rename a column No exception is thrown if this invalidates the table in order to permit more complex operations with invalid intermediate states.
Reimplemented from casacore::Table.
Definition at line 240 of file MSTable.h.
Referenced by casacore::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::renameColumn().
static const TableDesc& casacore::MSTable< ColEnum, KeyEnum >::requiredTableDesc | ( | ) | [static] |
return the required table description
const String& casacore::MSTable< ColEnum, KeyEnum >::unit | ( | ColEnum | which | ) | const [inline] |
Definition at line 138 of file MSTable.h.
Referenced by casacore::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::unit().
const String& casacore::MSTable< ColEnum, KeyEnum >::unit | ( | const String & | which | ) | const |
Return the UNIT keyword value associated with the specified column.
Bool casacore::MSTable< ColEnum, KeyEnum >::validate | ( | ) | const [inline] |
validate self (make sure that this MS is valid)
Definition at line 204 of file MSTable.h.
Referenced by casacore::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::validate().
static Bool casacore::MSTable< ColEnum, KeyEnum >::validate | ( | const TableRecord & | tabKeySet | ) | [static] |
check that the keyword set is valid
static Bool casacore::MSTable< ColEnum, KeyEnum >::validate | ( | const TableDesc & | tabDesc | ) | [static] |
tableDesc convenience functions
check that a TableDesc is valid
SimpleOrderedMap<Int, String> casacore::MSTable< ColEnum, KeyEnum >::colCommentMap_p [static, protected] |
SimpleOrderedMap<Int, Int> casacore::MSTable< ColEnum, KeyEnum >::colDTypeMap_p [static, protected] |
SimpleOrderedMap<Int, String> casacore::MSTable< ColEnum, KeyEnum >::colMeasureTypeMap_p [static, protected] |
SimpleOrderedMap<Int, String> casacore::MSTable< ColEnum, KeyEnum >::columnMap_p [static, protected] |
SimpleOrderedMap<Int, String> casacore::MSTable< ColEnum, KeyEnum >::colUnitMap_p [static, protected] |
SimpleOrderedMap<Int, String> casacore::MSTable< ColEnum, KeyEnum >::keyCommentMap_p [static, protected] |
SimpleOrderedMap<Int, Int> casacore::MSTable< ColEnum, KeyEnum >::keyDTypeMap_p [static, protected] |
SimpleOrderedMap<Int, String> casacore::MSTable< ColEnum, KeyEnum >::keywordMap_p [static, protected] |
CountedPtr<TableDesc> casacore::MSTable< ColEnum, KeyEnum >::requiredTD_p [static, protected] |