MSFieldColumns.h

Classes

ROMSFieldColumns -- A class to provide easy access to MSField columns (full description)
MSFieldColumns -- A class to provide easy read-write access to MSField columns (full description)

class ROMSFieldColumns

Interface

Public Members
ROMSFieldColumns(const MSField& msField)
~ROMSFieldColumns()
const ROScalarColumn<String>& code() const
const ROArrayColumn<Double>& delayDir() const
const ROArrayMeasColumn<MDirection>& delayDirMeasCol() const
const ROScalarColumn<Bool>& flagRow() const
const ROScalarColumn<String>& name() const
const ROScalarColumn<Int>& numPoly() const
const ROArrayColumn<Double>& phaseDir() const
const ROArrayMeasColumn<MDirection>& phaseDirMeasCol() const
const ROArrayColumn<Double>& referenceDir() const
const ROArrayMeasColumn<MDirection>& referenceDirMeasCol() const
const ROScalarColumn<Int>& sourceId() const
const ROScalarColumn<Double>& time() const
const ROScalarQuantColumn<Double>& timeQuant() const
const ROScalarMeasColumn<MEpoch>& timeMeas() const
const ROScalarColumn<Int>& ephemerisId() const
MDirection delayDirMeas(Int row, Double time = 0) const
MDirection phaseDirMeas(Int row, Double time = 0) const
MDirection referenceDirMeas(Int row, Double time = 0) const
uInt nrow() const
Int matchDirection(const MDirection& referenceDirection, const MDirection& delayDirection, const MDirection& phaseDirection, const Quantum<Double>& maxSeparation, Int tryRow=-1)
Protected Members
ROMSFieldColumns()
void attach(const MSField& msField)
Private Members
ROMSFieldColumns(const ROMSFieldColumns&)
ROMSFieldColumns& operator=(const ROMSFieldColumns&)
void attachOptionalCols(const MSField& msField)
Bool matchReferenceDir(uInt row, const MVDirection& dirVal, const Double& sepInRad, Matrix<Double>& mdir, MVDirection& mvdir) const
Bool matchDelayDir(uInt row, const MVDirection& dirVal, const Double& sepInRad, Matrix<Double>& mdir, MVDirection& mvdir) const
Bool matchPhaseDir(uInt row, const MVDirection& dirVal, const Double& sepInRad, Matrix<Double>& mdir, MVDirection& mvdir) const

Description

Review Status

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

Prerequisite

Etymology

ROMSFieldColumns stands for Read-Only MeasurementSet Field Table columns.

Synopsis

This class provides read-only access to the columns in the MSField Table. 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. See ROMSColumns for an example.

Motivation

See MSColumns for the motivation.

Member Description

ROMSFieldColumns(const MSField& msField)

Construct from the supplied Table

~ROMSFieldColumns()

The desctructor does nothing special

const ROScalarColumn<String>& code() const
const ROArrayColumn<Double>& delayDir() const
const ROArrayMeasColumn<MDirection>& delayDirMeasCol() const
const ROScalarColumn<Bool>& flagRow() const
const ROScalarColumn<String>& name() const
const ROScalarColumn<Int>& numPoly() const
const ROArrayColumn<Double>& phaseDir() const
const ROArrayMeasColumn<MDirection>& phaseDirMeasCol() const
const ROArrayColumn<Double>& referenceDir() const
const ROArrayMeasColumn<MDirection>& referenceDirMeasCol() const
const ROScalarColumn<Int>& sourceId() const
const ROScalarColumn<Double>& time() const
const ROScalarQuantColumn<Double>& timeQuant() const
const ROScalarMeasColumn<MEpoch>& timeMeas() const

Read-only access to required columns

const ROScalarColumn<Int>& ephemerisId() const

Read-only access to optional columns

MDirection delayDirMeas(Int row, Double time = 0) const
MDirection phaseDirMeas(Int row, Double time = 0) const
MDirection referenceDirMeas(Int row, Double time = 0) const

Access to interpolated directions, the default time of zero will return the 0th order element of the polynomial.

uInt nrow() const

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

Int matchDirection(const MDirection& referenceDirection, const MDirection& delayDirection, const MDirection& phaseDirection, const Quantum<Double>& maxSeparation, Int tryRow=-1)

returns the last row that has a reference direction, phase direction and delay direction that match, to within the specified angular separation, the supplied values. Only matches on rows where the direction is constant ie., NUM_POLY is 0 and where FLAG_ROW is False. Throws an exception (AipsError) if the reference frames do not match or if the separation does not have angular units (when compiled in debug mode). Returns -1 if no match could be found. If tryRow is positive, then that row is tested to see if it matches before any others are tested. Setting tryRow to a positive value greater than the table length will throw an exception (AipsError), when compiled in debug mode.

ROMSFieldColumns()

void attach(const MSField& msField)

ROMSFieldColumns(const ROMSFieldColumns&)

ROMSFieldColumns& operator=(const ROMSFieldColumns&)

void attachOptionalCols(const MSField& msField)

Bool matchReferenceDir(uInt row, const MVDirection& dirVal, const Double& sepInRad, Matrix<Double>& mdir, MVDirection& mvdir) const
Bool matchDelayDir(uInt row, const MVDirection& dirVal, const Double& sepInRad, Matrix<Double>& mdir, MVDirection& mvdir) const
Bool matchPhaseDir(uInt row, const MVDirection& dirVal, const Double& sepInRad, Matrix<Double>& mdir, MVDirection& mvdir) const


class MSFieldColumns: public ROMSFieldColumns

Interface

Public Members
MSFieldColumns(MSField& msField)
~MSFieldColumns()
ScalarColumn<String>& code()
ArrayColumn<Double>& delayDir()
ArrayMeasColumn<MDirection>& delayDirMeasCol()
ScalarColumn<Bool>& flagRow()
ScalarColumn<String>& name()
ScalarColumn<Int>& numPoly()
ArrayColumn<Double>& phaseDir()
ArrayMeasColumn<MDirection>& phaseDirMeasCol()
ArrayColumn<Double>& referenceDir()
ArrayMeasColumn<MDirection>& referenceDirMeasCol()
ScalarColumn<Int>& sourceId()
ScalarColumn<Double>& time()
ScalarQuantColumn<Double>& timeQuant()
ScalarMeasColumn<MEpoch>& timeMeas()
ScalarColumn<Int>& ephemerisId()
const ROScalarColumn<String>& code() const
const ROArrayColumn<Double>& delayDir() const
const ROArrayMeasColumn<MDirection>& delayDirMeasCol() const
const ROScalarColumn<Bool>& flagRow() const
const ROScalarColumn<String>& name() const
const ROScalarColumn<Int>& numPoly() const
const ROArrayColumn<Double>& phaseDir() const
const ROArrayMeasColumn<MDirection>& phaseDirMeasCol() const
const ROArrayColumn<Double>& referenceDir() const
const ROArrayMeasColumn<MDirection>& referenceDirMeasCol() const
const ROScalarColumn<Int>& sourceId() const
const ROScalarColumn<Double>& time() const
const ROScalarQuantColumn<Double>& timeQuant() const
const ROScalarMeasColumn<MEpoch>& timeMeas() const
const ROScalarColumn<Int>& ephemerisId() const
static MDirection interpolateDirMeas(const Array<MDirection>& arrDir, Int numPoly, Double interTime, Double timeOrigin)
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
void setDirectionRef(MDirection::Types ref)
Protected Members
MSFieldColumns()
void attach(MSField& msField)
Private Members
MSFieldColumns(const MSFieldColumns&)
MSFieldColumns& operator=(const MSFieldColumns&)
void attachOptionalCols(MSField& msField)

Description

Review Status

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

Prerequisite

Etymology

MSFieldColumns stands for MeasurementSet Field Table columns.

Synopsis

This class provides access to the columns in the MSField Table, 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. See MSColumns for an example.

Motivation

See MSColumns for the motivation.

Member Description

MSFieldColumns(MSField& msField)

Construct from the supplied Table

~MSFieldColumns()

The desctructor does nothing special

ScalarColumn<String>& code()
ArrayColumn<Double>& delayDir()
ArrayMeasColumn<MDirection>& delayDirMeasCol()
ScalarColumn<Bool>& flagRow()
ScalarColumn<String>& name()
ScalarColumn<Int>& numPoly()
ArrayColumn<Double>& phaseDir()
ArrayMeasColumn<MDirection>& phaseDirMeasCol()
ArrayColumn<Double>& referenceDir()
ArrayMeasColumn<MDirection>& referenceDirMeasCol()
ScalarColumn<Int>& sourceId()
ScalarColumn<Double>& time()
ScalarQuantColumn<Double>& timeQuant()
ScalarMeasColumn<MEpoch>& timeMeas()

Read-write access to required columns

Note that the direction measures with a stored polynomial have Col() added to their name. They are better accessed via the functions that have the same name, without the Col suffix, that will do the interpolation for you. These functions are in the ROMSFieldColumns class.

ScalarColumn<Int>& ephemerisId()

Read-write access to optional columns

const ROScalarColumn<String>& code() const
const ROArrayColumn<Double>& delayDir() const
const ROArrayMeasColumn<MDirection>& delayDirMeasCol() const
const ROScalarColumn<Bool>& flagRow() const
const ROScalarColumn<String>& name() const
const ROScalarColumn<Int>& numPoly() const
const ROArrayColumn<Double>& phaseDir() const
const ROArrayMeasColumn<MDirection>& phaseDirMeasCol() const
const ROArrayColumn<Double>& referenceDir() const
const ROArrayMeasColumn<MDirection>& referenceDirMeasCol() const
const ROScalarColumn<Int>& sourceId() const
const ROScalarColumn<Double>& time() const
const ROScalarQuantColumn<Double>& timeQuant() const
const ROScalarMeasColumn<MEpoch>& timeMeas() const

Read-only access to required columns

const ROScalarColumn<Int>& ephemerisId() const

Read-only access to optional columns

static MDirection interpolateDirMeas(const Array<MDirection>& arrDir, Int numPoly, Double interTime, Double timeOrigin)

Interpolate the direction Measure polynomial

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

set the epoch reference type for the TIME column.

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 setDirectionRef(MDirection::Types ref)

set the direction reference type for the REFERENCE_DIR, DELAY_DIR & PHASE_DIR columns. This can only be done when the table has no rows. Trying to do so at other times will throw an exception.

MSFieldColumns()

void attach(MSField& msField)

MSFieldColumns(const MSFieldColumns&)

MSFieldColumns& operator=(const MSFieldColumns&)

void attachOptionalCols(MSField& msField)