casa
$Rev:20696$
|
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) | |
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. | |
MSTable () | |
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) | |
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 SimpleCountedConstPtr < 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. |
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. 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).
casa::MSTable< ColEnum, KeyEnum >::MSTable | ( | ) | [protected] |
These constructors mirror the Table ones Default constructor for use by derived classes
casa::MSTable< ColEnum, KeyEnum >::MSTable | ( | const String & | tableName, |
TableOption | option | ||
) | [protected] |
casa::MSTable< ColEnum, KeyEnum >::MSTable | ( | const String & | tableName, |
const TableLock & | lockOptions, | ||
TableOption | option | ||
) | [protected] |
casa::MSTable< ColEnum, KeyEnum >::MSTable | ( | const String & | tableName, |
const String & | tableDescName, | ||
TableOption | option | ||
) | [protected] |
casa::MSTable< ColEnum, KeyEnum >::MSTable | ( | const String & | tableName, |
const String & | tableDescName, | ||
const TableLock & | lockOptions, | ||
TableOption | option | ||
) | [protected] |
casa::MSTable< ColEnum, KeyEnum >::MSTable | ( | SetupNewTable & | newTab, |
uInt | nrrow, | ||
Bool | initialize | ||
) | [protected] |
casa::MSTable< ColEnum, KeyEnum >::MSTable | ( | SetupNewTable & | newTab, |
const TableLock & | lockOptions, | ||
uInt | nrrow, | ||
Bool | initialize | ||
) | [protected] |
casa::MSTable< ColEnum, KeyEnum >::MSTable | ( | const Table & | table | ) | [protected] |
casa::MSTable< ColEnum, KeyEnum >::MSTable | ( | const MSTable< ColEnum, KeyEnum > & | other | ) | [protected] |
casa::MSTable< ColEnum, KeyEnum >::~MSTable | ( | ) | [protected] |
static void casa::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 casa::MSTable< ColEnum, KeyEnum >::addColumnToDesc | ( | TableDesc & | tabDesc, |
ColEnum | which, | ||
Int | ndim = -1 , |
||
const String & | refCol = "" |
||
) | [static] |
static void casa::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 casa::MSTable< ColEnum, KeyEnum >::addKeyToDesc | ( | TableDesc & | tabDesc, |
KeyEnum | key | ||
) | [static] |
static void casa::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 casa::MSTable< ColEnum, KeyEnum >::columnDataType | ( | ColEnum | which | ) | [static] |
return the data type for a given ColEnum
static const String& casa::MSTable< ColEnum, KeyEnum >::columnMeasureType | ( | ColEnum | which | ) | [static] |
return the MEASURE_TYPE string for a given ColEnum
static const String& casa::MSTable< ColEnum, KeyEnum >::columnName | ( | ColEnum | which | ) | [static] |
Convert a ColEnum to the actual column name.
Referenced by casa::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::unit().
static const String& casa::MSTable< ColEnum, KeyEnum >::columnStandardComment | ( | ColEnum | which | ) | [static] |
return the standard comment for a given ColEnum
static ColEnum casa::MSTable< ColEnum, KeyEnum >::columnType | ( | const String & | name | ) | [static] |
Convert a name to a ColEnum.
static const String& casa::MSTable< ColEnum, KeyEnum >::columnUnit | ( | ColEnum | which | ) | [static] |
return the UNIT string for a given ColEnum
Bool casa::MSTable< ColEnum, KeyEnum >::isArray | ( | ColEnum | which | ) | const |
Bool casa::MSTable< ColEnum, KeyEnum >::isColumn | ( | ColEnum | which | ) | const |
Bool casa::MSTable< ColEnum, KeyEnum >::isColumnWritable | ( | ColEnum | which | ) | const |
check to see if a column is writable
Referenced by casa::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::isColumnWritable().
Bool casa::MSTable< ColEnum, KeyEnum >::isColumnWritable | ( | const String & | columnName | ) | const [inline] |
Test if the given column is writable.
Reimplemented from casa::Table.
Bool casa::MSTable< ColEnum, KeyEnum >::isColumnWritable | ( | uInt | columnIndex | ) | const [inline] |
Reimplemented from casa::Table.
Bool casa::MSTable< ColEnum, KeyEnum >::isKeyword | ( | KeyEnum | which | ) | const |
check to see if a keyword exists
Bool casa::MSTable< ColEnum, KeyEnum >::isScalar | ( | ColEnum | which | ) | const |
Information about scalar vs array of a column.
static void casa::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 casa::MSTable< ColEnum, KeyEnum >::keywordDataType | ( | KeyEnum | which | ) | [static] |
static const String& casa::MSTable< ColEnum, KeyEnum >::keywordName | ( | KeyEnum | which | ) | [static] |
static const String& casa::MSTable< ColEnum, KeyEnum >::keywordStandardComment | ( | KeyEnum | which | ) | [static] |
static KeyEnum casa::MSTable< ColEnum, KeyEnum >::keywordType | ( | const String & | name | ) | [static] |
MSTable& casa::MSTable< ColEnum, KeyEnum >::operator= | ( | const MSTable< ColEnum, KeyEnum > & | ) | [protected] |
Assignment operator, reference semantics.
Table casa::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 casa::MeasurementSet, casa::MSAntenna, casa::MSDataDescription, casa::MSDoppler, casa::MSFeed, casa::MSField, casa::MSFlagCmd, casa::MSFreqOffset, casa::MSObservation, casa::MSPointing, casa::MSPolarization, casa::MSSpectralWindow, casa::MSState, casa::MSSysCal, casa::MSWeather, casa::MSHistory, casa::MSProcessor, and casa::MSSource.
static const TableDesc& casa::MSTable< ColEnum, KeyEnum >::requiredTableDesc | ( | ) | [static] |
return the required table description
const String& casa::MSTable< ColEnum, KeyEnum >::unit | ( | const String & | which | ) | const |
Return the UNIT keyword value associated with the specified column.
const String& casa::MSTable< ColEnum, KeyEnum >::unit | ( | ColEnum | which | ) | const [inline] |
Definition at line 138 of file MSTable.h.
Referenced by casa::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::unit().
static Bool casa::MSTable< ColEnum, KeyEnum >::validate | ( | const TableDesc & | tabDesc | ) | [static] |
tableDesc convenience functions
check that a TableDesc is valid
static Bool casa::MSTable< ColEnum, KeyEnum >::validate | ( | const TableRecord & | tabKeySet | ) | [static] |
check that the keyword set is valid
Bool casa::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 casa::MSTable< MSPointingEnums::PredefinedColumns, MSPointingEnums::PredefinedKeywords >::validate().
SimpleOrderedMap<Int, String> casa::MSTable< ColEnum, KeyEnum >::colCommentMap_p [static, protected] |
SimpleOrderedMap<Int, Int> casa::MSTable< ColEnum, KeyEnum >::colDTypeMap_p [static, protected] |
SimpleOrderedMap<Int, String> casa::MSTable< ColEnum, KeyEnum >::colMeasureTypeMap_p [static, protected] |
SimpleOrderedMap<Int, String> casa::MSTable< ColEnum, KeyEnum >::columnMap_p [static, protected] |
SimpleOrderedMap<Int, String> casa::MSTable< ColEnum, KeyEnum >::colUnitMap_p [static, protected] |
SimpleOrderedMap<Int, String> casa::MSTable< ColEnum, KeyEnum >::keyCommentMap_p [static, protected] |
SimpleOrderedMap<Int, Int> casa::MSTable< ColEnum, KeyEnum >::keyDTypeMap_p [static, protected] |
SimpleOrderedMap<Int, String> casa::MSTable< ColEnum, KeyEnum >::keywordMap_p [static, protected] |
SimpleCountedConstPtr<TableDesc> casa::MSTable< ColEnum, KeyEnum >::requiredTD_p [static, protected] |