MSMainColumns.h

Classes

ROMSMainColumns -- A class for easy read-only access to MeasurementSet main table columns (full description)
MSMainColumns -- A class for easy read-write access to MeasurementSet main table columns (full description)

class ROMSMainColumns

Interface

Public Members
ROMSMainColumns(const MeasurementSet& ms)
~ROMSMainColumns()
const ROScalarColumn<Int>& antenna1() const
const ROScalarColumn<Int>& antenna2() const
const ROScalarColumn<Int>& arrayId() const
const ROScalarColumn<Int>& dataDescId() const
const ROScalarColumn<Double>& exposure() const
const ROScalarQuantColumn<Double>& exposureQuant() const
const ROScalarColumn<Int>& feed1() const
const ROScalarColumn<Int>& feed2() const
const ROScalarColumn<Int>& fieldId() const
const ROArrayColumn<Bool>& flag() const
const ROArrayColumn<Bool>& flagCategory() const
const ROScalarColumn<Bool>& flagRow() const
const ROScalarColumn<Double>& interval() const
const ROScalarQuantColumn<Double>& intervalQuant() const
const ROScalarColumn<Int>& observationId() const
const ROScalarColumn<Int>& processorId() const
const ROScalarColumn<Int>& scanNumber() const
const ROArrayColumn<Float>& sigma() const
const ROScalarColumn<Int>& stateId() const
const ROScalarColumn<Double>& time() const
const ROScalarQuantColumn<Double>& timeQuant() const
const ROScalarMeasColumn<MEpoch>& timeMeas() const
const ROScalarColumn<Double>& timeCentroid() const
const ROScalarQuantColumn<Double>& timeCentroidQuant() const
const ROScalarMeasColumn<MEpoch>& timeCentroidMeas() const
const ROArrayColumn<Double>& uvw() const
const ROArrayQuantColumn<Double>& uvwQuant() const
const ROScalarMeasColumn<Muvw>& uvwMeas() const
const ROArrayColumn<Float>& weight() const
const ROScalarColumn<Int>& antenna3() const
const ROScalarColumn<Bool>& baselineRef() const
const ROArrayColumn<Complex>& correctedData() const
const ROArrayColumn<Complex>& data() const
const ROScalarColumn<Int>& feed3() const
const ROArrayColumn<Float>& floatData() const
const ROArrayColumn<Float>& imagingWeight() const
const ROArrayColumn<Complex>& lagData() const
const ROArrayColumn<Complex>& modelData() const
const ROScalarColumn<Int>& phaseId() const
const ROScalarColumn<Int>& pulsarBin() const
const ROScalarColumn<Int>& pulsarGateId() const
const ROArrayColumn<Float>& sigmaSpectrum() const
const ROScalarColumn<Double>& timeExtraPrec() const
const ROScalarQuantColumn<Double>& timeExtraPrecQuant() const
const ROArrayColumn<Double>& uvw2() const
const ROScalarMeasColumn<Muvw>& uvw2Meas() const
const ROArrayQuantColumn<Double>& uvw2Quant() const
const ROArrayColumn<Complex>& videoPoint() const
const ROArrayColumn<Float>& weightSpectrum() const
uInt nrow() const
Vector<String> flagCategories() const
Protected Members
ROMSMainColumns()
void attach(const MeasurementSet& ms)
Private Members
ROMSMainColumns(const ROMSMainColumns&)
ROMSMainColumns& operator=(const ROMSMainColumns&)
void attachOptionalCols(const MeasurementSet& ms)

Description

Review Status

Reviewed By:
Bob Garwood
Date Reviewed:
1997/02/01

Prerequisite

Etymology

ROMSColumns stands for Read-Only MeasurementSet Table columns.

Synopsis

This class provides read-only access to the columns in the MeasurementSet. It does the declaration of all the Scalar and ArrayColumns with the correct types, so the application programmer doesn't have to worry about getting those right. There is an access function for every predefined column. Access to non-predefined columns will still have to be done with explicit declarations.
Warning The Table that is used to construct this class must not be destroyed (or go out of scope) before this class does. Otherwise the scalar and array columns use by this class will be left dangling.

Example

    // use as follows
    MeasurementSet ms("myMS"); 
    ROMSColumns msc(ms);
    // show data from row 5
    cout << msc.data()(5);
    // show name of antenna on row 3 in antenna table
    cout << msc.antenna().name();
    

Motivation

See MSColumns for the motivation.

To Do

Member Description

ROMSMainColumns(const MeasurementSet& ms)

Create a columns object that accesses the data in the specified Table

~ROMSMainColumns()

The desctructor does nothing special

const ROScalarColumn<Int>& antenna1() const
const ROScalarColumn<Int>& antenna2() const
const ROScalarColumn<Int>& arrayId() const
const ROScalarColumn<Int>& dataDescId() const
const ROScalarColumn<Double>& exposure() const
const ROScalarQuantColumn<Double>& exposureQuant() const
const ROScalarColumn<Int>& feed1() const
const ROScalarColumn<Int>& feed2() const
const ROScalarColumn<Int>& fieldId() const
const ROArrayColumn<Bool>& flag() const
const ROArrayColumn<Bool>& flagCategory() const
const ROScalarColumn<Bool>& flagRow() const
const ROScalarColumn<Double>& interval() const
const ROScalarQuantColumn<Double>& intervalQuant() const
const ROScalarColumn<Int>& observationId() const
const ROScalarColumn<Int>& processorId() const
const ROScalarColumn<Int>& scanNumber() const
const ROArrayColumn<Float>& sigma() const
const ROScalarColumn<Int>& stateId() const
const ROScalarColumn<Double>& time() const
const ROScalarQuantColumn<Double>& timeQuant() const
const ROScalarMeasColumn<MEpoch>& timeMeas() const
const ROScalarColumn<Double>& timeCentroid() const
const ROScalarQuantColumn<Double>& timeCentroidQuant() const
const ROScalarMeasColumn<MEpoch>& timeCentroidMeas() const
const ROArrayColumn<Double>& uvw() const
const ROArrayQuantColumn<Double>& uvwQuant() const
const ROScalarMeasColumn<Muvw>& uvwMeas() const
const ROArrayColumn<Float>& weight() const

Access to required columns

const ROScalarColumn<Int>& antenna3() const
const ROScalarColumn<Bool>& baselineRef() const
const ROArrayColumn<Complex>& correctedData() const
const ROArrayColumn<Complex>& data() const
const ROScalarColumn<Int>& feed3() const
const ROArrayColumn<Float>& floatData() const
const ROArrayColumn<Float>& imagingWeight() const
const ROArrayColumn<Complex>& lagData() const
const ROArrayColumn<Complex>& modelData() const
const ROScalarColumn<Int>& phaseId() const
const ROScalarColumn<Int>& pulsarBin() const
const ROScalarColumn<Int>& pulsarGateId() const
const ROArrayColumn<Float>& sigmaSpectrum() const
const ROScalarColumn<Double>& timeExtraPrec() const
const ROScalarQuantColumn<Double>& timeExtraPrecQuant() const
const ROArrayColumn<Double>& uvw2() const
const ROScalarMeasColumn<Muvw>& uvw2Meas() const
const ROArrayQuantColumn<Double>& uvw2Quant() const
const ROArrayColumn<Complex>& videoPoint() const
const ROArrayColumn<Float>& weightSpectrum() const

Access to optional columns

uInt nrow() const

Convenience function that returns the number of rows in any of the columns

Vector<String> flagCategories() const

Returns the category labels for the FLAG_CATEGORY column.

ROMSMainColumns()

void attach(const MeasurementSet& ms)

ROMSMainColumns(const ROMSMainColumns&)

ROMSMainColumns& operator=(const ROMSMainColumns&)

void attachOptionalCols(const MeasurementSet& ms)


class MSMainColumns: public ROMSMainColumns

Interface

Public Members
MSMainColumns(MeasurementSet& ms)
~MSMainColumns()
ScalarColumn<Int>& antenna1()
ScalarColumn<Int>& antenna2()
ScalarColumn<Int>& arrayId()
ScalarColumn<Int>& dataDescId()
ScalarColumn<Double>& exposure()
ScalarQuantColumn<Double>& exposureQuant()
ScalarColumn<Int>& feed1()
ScalarColumn<Int>& feed2()
ScalarColumn<Int>& fieldId()
ArrayColumn<Bool>& flag()
ArrayColumn<Bool>& flagCategory()
ScalarColumn<Bool>& flagRow()
ScalarColumn<Double>& interval()
ScalarQuantColumn<Double>& intervalQuant()
ScalarColumn<Int>& observationId()
ScalarColumn<Int>& processorId()
ScalarColumn<Int>& scanNumber()
ArrayColumn<Float>& sigma()
ScalarColumn<Int>& stateId()
ScalarColumn<Double>& time()
ScalarQuantColumn<Double>& timeQuant()
ScalarMeasColumn<MEpoch>& timeMeas()
ScalarColumn<Double>& timeCentroid()
ScalarQuantColumn<Double>& timeCentroidQuant()
ScalarMeasColumn<MEpoch>& timeCentroidMeas()
ArrayColumn<Double>& uvw()
ArrayQuantColumn<Double>& uvwQuant()
ScalarMeasColumn<Muvw>& uvwMeas()
ArrayColumn<Float>& weight()
ScalarColumn<Int>& antenna3()
ScalarColumn<Bool>& baselineRef()
ArrayColumn<Complex>& correctedData()
ArrayColumn<Complex>& data()
ScalarColumn<Int>& feed3()
ArrayColumn<Float>& floatData()
ArrayColumn<Float>& imagingWeight()
ArrayColumn<Complex>& lagData()
ArrayColumn<Complex>& modelData()
ScalarColumn<Int>& phaseId()
ScalarColumn<Int>& pulsarBin()
ScalarColumn<Int>& pulsarGateId()
ArrayColumn<Float>& sigmaSpectrum()
ScalarColumn<Double>& timeExtraPrec()
ScalarQuantColumn<Double>& timeExtraPrecQuant()
ArrayColumn<Double>& uvw2()
ScalarMeasColumn<Muvw>& uvw2Meas()
ArrayQuantColumn<Double>& uvw2Quant()
ArrayColumn<Complex>& videoPoint()
ArrayColumn<Float>& weightSpectrum()
const ROScalarColumn<Int>& antenna1() const
const ROScalarColumn<Int>& antenna2() const
const ROScalarColumn<Int>& arrayId() const
const ROScalarColumn<Int>& dataDescId() const
const ROScalarColumn<Double>& exposure() const
const ROScalarQuantColumn<Double>& exposureQuant() const
const ROScalarColumn<Int>& feed1() const
const ROScalarColumn<Int>& feed2() const
const ROScalarColumn<Int>& fieldId() const
const ROArrayColumn<Bool>& flag() const
const ROArrayColumn<Bool>& flagCategory() const
const ROScalarColumn<Bool>& flagRow() const
const ROScalarColumn<Double>& interval() const
const ROScalarQuantColumn<Double>& intervalQuant() const
const ROScalarColumn<Int>& observationId() const
const ROScalarColumn<Int>& processorId() const
const ROScalarColumn<Int>& scanNumber() const
const ROArrayColumn<Float>& sigma() const
const ROScalarColumn<Int>& stateId() const
const ROScalarColumn<Double>& time() const
const ROScalarQuantColumn<Double>& timeQuant() const
const ROScalarMeasColumn<MEpoch>& timeMeas() const
const ROScalarColumn<Double>& timeCentroid() const
const ROScalarQuantColumn<Double>& timeCentroidQuant() const
const ROScalarMeasColumn<MEpoch>& timeCentroidMeas() const
const ROArrayColumn<Double>& uvw() const
const ROArrayQuantColumn<Double>& uvwQuant() const
const ROScalarMeasColumn<Muvw>& uvwMeas() const
const ROArrayColumn<Float>& weight() const
const ROScalarColumn<Int>& antenna3() const
const ROScalarColumn<Bool>& baselineRef() const
const ROArrayColumn<Complex>& correctedData() const
const ROArrayColumn<Complex>& data() const
const ROScalarColumn<Int>& feed3() const
const ROArrayColumn<Float>& floatData() const
const ROArrayColumn<Float>& imagingWeight() const
const ROArrayColumn<Complex>& lagData() const
const ROArrayColumn<Complex>& modelData() const
const ROScalarColumn<Int>& phaseId() const
const ROScalarColumn<Int>& pulsarBin() const
const ROScalarColumn<Int>& pulsarGateId() const
const ROArrayColumn<Float>& sigmaSpectrum() const
const ROScalarColumn<Double>& timeExtraPrec() const
const ROScalarQuantColumn<Double>& timeExtraPrecQuant() const
const ROArrayColumn<Double>& uvw2() const
const ROScalarMeasColumn<Muvw>& uvw2Meas() const
const ROArrayQuantColumn<Double>& uvw2Quant() const
const ROArrayColumn<Complex>& videoPoint() const
const ROArrayColumn<Float>& weightSpectrum() const
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
void setUVWRef(Muvw::Types ref)
void setFlagCategories(const Vector<String>& categories)
Protected Members
MSMainColumns()
void attach(MeasurementSet& ms)
Private Members
MSMainColumns(const MSMainColumns&)
MSMainColumns& operator=(const MSMainColumns&)
void attachOptionalCols(MeasurementSet& ms)

Description

Review Status

Reviewed By:
Bob Garwood
Date Reviewed:
1997/02/01

Prerequisite

Etymology

MSMainColumns stands for MeasurementSet main Table columns.

Synopsis

This class provides access to the columns in the MeasurementSet. It does the declaration of all the Scalar and ArrayColumns with the correct types, so the application programmer doesn't have to worry about getting those right. There is an access function for every predefined column. Access to non-predefined columns will still have to be done with explicit declarations.
Warning The Table that is used to construct this class must not be destroyed (or go out of scope) before this class does. Otherwise the scalar and array columns use by this class will be left dangling.

Example

    // use as follows
    MeasurementSet ms("myMS",Table::Update); 
    MSColumns msc(ms);
    // show data from row 5
    cout << msc.data()(5);
    // change name of antenna on row 3 in antenna table
    msc.antenna().name().put(3,"NewAnt-3");
    

Motivation

Having to type long lists of Scalar and Array column declarations gets very tedious. This class attempts to relieve some of that tedium, while at the same time concentrating all the declarations in one place, making Type errors in the column declaration (only caught at run-time) less probable. Type errors in the use of the columns is caught at compile time.

To Do

Member Description

MSMainColumns(MeasurementSet& ms)

Create a columns object that accesses the data in the specified Table

~MSMainColumns()

The desctructor does nothing special

ScalarColumn<Int>& antenna1()
ScalarColumn<Int>& antenna2()
ScalarColumn<Int>& arrayId()
ScalarColumn<Int>& dataDescId()
ScalarColumn<Double>& exposure()
ScalarQuantColumn<Double>& exposureQuant()
ScalarColumn<Int>& feed1()
ScalarColumn<Int>& feed2()
ScalarColumn<Int>& fieldId()
ArrayColumn<Bool>& flag()
ArrayColumn<Bool>& flagCategory()
ScalarColumn<Bool>& flagRow()
ScalarColumn<Double>& interval()
ScalarQuantColumn<Double>& intervalQuant()
ScalarColumn<Int>& observationId()
ScalarColumn<Int>& processorId()
ScalarColumn<Int>& scanNumber()
ArrayColumn<Float>& sigma()
ScalarColumn<Int>& stateId()
ScalarColumn<Double>& time()
ScalarQuantColumn<Double>& timeQuant()
ScalarMeasColumn<MEpoch>& timeMeas()
ScalarColumn<Double>& timeCentroid()
ScalarQuantColumn<Double>& timeCentroidQuant()
ScalarMeasColumn<MEpoch>& timeCentroidMeas()
ArrayColumn<Double>& uvw()
ArrayQuantColumn<Double>& uvwQuant()
ScalarMeasColumn<Muvw>& uvwMeas()
ArrayColumn<Float>& weight()

Read-write access to required columns

ScalarColumn<Int>& antenna3()
ScalarColumn<Bool>& baselineRef()
ArrayColumn<Complex>& correctedData()
ArrayColumn<Complex>& data()
ScalarColumn<Int>& feed3()
ArrayColumn<Float>& floatData()
ArrayColumn<Float>& imagingWeight()
ArrayColumn<Complex>& lagData()
ArrayColumn<Complex>& modelData()
ScalarColumn<Int>& phaseId()
ScalarColumn<Int>& pulsarBin()
ScalarColumn<Int>& pulsarGateId()
ArrayColumn<Float>& sigmaSpectrum()
ScalarColumn<Double>& timeExtraPrec()
ScalarQuantColumn<Double>& timeExtraPrecQuant()
ArrayColumn<Double>& uvw2()
ScalarMeasColumn<Muvw>& uvw2Meas()
ArrayQuantColumn<Double>& uvw2Quant()
ArrayColumn<Complex>& videoPoint()
ArrayColumn<Float>& weightSpectrum()

Read-write access to optional columns

const ROScalarColumn<Int>& antenna1() const
const ROScalarColumn<Int>& antenna2() const
const ROScalarColumn<Int>& arrayId() const
const ROScalarColumn<Int>& dataDescId() const
const ROScalarColumn<Double>& exposure() const
const ROScalarQuantColumn<Double>& exposureQuant() const
const ROScalarColumn<Int>& feed1() const
const ROScalarColumn<Int>& feed2() const
const ROScalarColumn<Int>& fieldId() const
const ROArrayColumn<Bool>& flag() const
const ROArrayColumn<Bool>& flagCategory() const
const ROScalarColumn<Bool>& flagRow() const
const ROScalarColumn<Double>& interval() const
const ROScalarQuantColumn<Double>& intervalQuant() const
const ROScalarColumn<Int>& observationId() const
const ROScalarColumn<Int>& processorId() const
const ROScalarColumn<Int>& scanNumber() const
const ROArrayColumn<Float>& sigma() const
const ROScalarColumn<Int>& stateId() const
const ROScalarColumn<Double>& time() const
const ROScalarQuantColumn<Double>& timeQuant() const
const ROScalarMeasColumn<MEpoch>& timeMeas() const
const ROScalarColumn<Double>& timeCentroid() const
const ROScalarQuantColumn<Double>& timeCentroidQuant() const
const ROScalarMeasColumn<MEpoch>& timeCentroidMeas() const
const ROArrayColumn<Double>& uvw() const
const ROArrayQuantColumn<Double>& uvwQuant() const
const ROScalarMeasColumn<Muvw>& uvwMeas() const
const ROArrayColumn<Float>& weight() const

Read-only access to required columns

const ROScalarColumn<Int>& antenna3() const
const ROScalarColumn<Bool>& baselineRef() const
const ROArrayColumn<Complex>& correctedData() const
const ROArrayColumn<Complex>& data() const
const ROScalarColumn<Int>& feed3() const
const ROArrayColumn<Float>& floatData() const
const ROArrayColumn<Float>& imagingWeight() const
const ROArrayColumn<Complex>& lagData() const
const ROArrayColumn<Complex>& modelData() const
const ROScalarColumn<Int>& phaseId() const
const ROScalarColumn<Int>& pulsarBin() const
const ROScalarColumn<Int>& pulsarGateId() const
const ROArrayColumn<Float>& sigmaSpectrum() const
const ROScalarColumn<Double>& timeExtraPrec() const
const ROScalarQuantColumn<Double>& timeExtraPrecQuant() const
const ROArrayColumn<Double>& uvw2() const
const ROScalarMeasColumn<Muvw>& uvw2Meas() const
const ROArrayQuantColumn<Double>& uvw2Quant() const
const ROArrayColumn<Complex>& videoPoint() const
const ROArrayColumn<Float>& weightSpectrum() const

Read-only access to optional columns

void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)

set the epoch type for the TIME and TIME_CENTROID columns.

Tip In principle this function can only be used if the table is empty, otherwise already written values may thereafter have an incorrect reference, offset, or unit. However, it is possible that part of the table gets written before these values are known. In that case the reference, offset, or units can be set by using a False tableMustBeEmpty argument.

void setUVWRef(Muvw::Types ref)

set the UVW reference type for the UVW and UVW2 (if defined) columns. This can only be done when the table has no rows. Trying to do so at other times will throw an exception.

void setFlagCategories(const Vector<String>& categories)

Set the flag category labels to the supplied values (in the CATEGORY keyword of the FLAG_CATEGORY column). Throws an exception, when compiled in Debug mode, if the length of the supplied Vector is not the same as the length of the third dimension of the FLAG_CATEGORY column.

MSMainColumns()

void attach(MeasurementSet& ms)

MSMainColumns(const MSMainColumns&)

MSMainColumns& operator=(const MSMainColumns&)

void attachOptionalCols(MeasurementSet& ms)