casacore
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::MSFieldColumns Class Reference

More...

#include <MSFieldColumns.h>

Public Member Functions

 MSFieldColumns (const MSField &msField)
 Construct from the supplied Table. More...
 
 ~MSFieldColumns ()
 The desctructor does nothing special. More...
 
ScalarColumn< String > & code ()
 Access to required columns. More...
 
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 ()
 
const ScalarColumn< String > & code () const
 Const access to required columns. More...
 
const ArrayColumn< Double > & delayDir () const
 
const ArrayMeasColumn< MDirection > & delayDirMeasCol () const
 
const ScalarColumn< Bool > & flagRow () const
 
const ScalarColumn< String > & name () const
 
const ScalarColumn< Int > & numPoly () const
 
const ArrayColumn< Double > & phaseDir () const
 
const ArrayMeasColumn< MDirection > & phaseDirMeasCol () const
 
const ArrayColumn< Double > & referenceDir () const
 
const ArrayMeasColumn< MDirection > & referenceDirMeasCol () const
 
const ScalarColumn< Int > & sourceId () const
 
const ScalarColumn< Double > & time () const
 
const ScalarQuantColumn< Double > & timeQuant () const
 
const ScalarMeasColumn< MEpoch > & timeMeas () const
 
ScalarColumn< Int > & ephemerisId ()
 Access to optional columns. More...
 
const ScalarColumn< Int > & ephemerisId () const
 Const access to optional columns. More...
 
void setEpochRef (MEpoch::Types ref, Bool tableMustBeEmpty=True)
 set the epoch reference type for the TIME column. More...
 
void setDirectionRef (MDirection::Types ref)
 set the direction reference type for the REFERENCE_DIR, DELAY_DIR & PHASE_DIR columns. More...
 
MDirection delayDirMeas (rownr_t row, Double time=0) const
 Access to interpolated directions from polynomials or ephemerides, the default time of zero will return the 0th order element of the polynomial. More...
 
MDirection phaseDirMeas (rownr_t row, Double time=0) const
 
MDirection referenceDirMeas (rownr_t row, Double time=0) const
 
MDirection ephemerisDirMeas (rownr_t row, Double time=0) const
 
MRadialVelocity radVelMeas (rownr_t row, Double time=0) const
 
Quantity rho (rownr_t row, Double time=0) const
 
Bool needInterTime (rownr_t row) const
 
String ephemPath (rownr_t row) const
 
rownr_t nrow () const
 Convenience function that returns the number of rows in any of the columns. More...
 
Int64 matchDirection (const MDirection &referenceDirection, const MDirection &delayDirection, const MDirection &phaseDirection, const Quantum< Double > &maxSeparation, Int64 tryRow=-1, Double time=0)
 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. More...
 
void updateMeasComets ()
 Update the MeasComets objects belonging to this FIELD table. More...
 

Static Public Member Functions

static MDirection interpolateDirMeas (const Array< MDirection > &arrDir, Int numPoly, Double interTime, Double timeOrigin)
 Interpolate the direction Measure polynomial. More...
 

Protected Member Functions

 MSFieldColumns ()
 
void attach (const MSField &msField)
 

Private Member Functions

 MSFieldColumns (const MSFieldColumns &)
 
MSFieldColumnsoperator= (const MSFieldColumns &)
 
void attachOptionalCols (const MSField &msField)
 
Bool matchReferenceDir (rownr_t row, const MVDirection &dirVal, const Double &sepInRad, MVDirection &mvdir, Double time=0) const
 
Bool matchDelayDir (rownr_t row, const MVDirection &dirVal, const Double &sepInRad, MVDirection &mvdir, Double time=0) const
 
Bool matchPhaseDir (rownr_t row, const MVDirection &dirVal, const Double &sepInRad, MVDirection &mvdir, Double time=0) const
 
Int measCometIndex (rownr_t row) const
 
MDirection extractDirMeas (const MDirection &offsetDir, Int index, Double &interTime, MEpoch originEpoch) const
 Extract the direction Measure from the corresponding ephemeris using the nominal position as an offset. More...
 
void getMJDs (Double &originMJD, Double &interMJD, const Double interTime, const MEpoch originEpoch) const
 

Private Attributes

String measCometsPath_p
 
Vector< MeasComet * > measCometsV_p
 
std::map< Int, IntephIdToMeasComet_p
 
ScalarColumn< Stringname_p
 
ScalarColumn< Stringcode_p
 
ScalarColumn< Doubletime_p
 
ScalarColumn< IntnumPoly_p
 
ArrayColumn< DoubledelayDir_p
 
ArrayColumn< DoublephaseDir_p
 
ArrayColumn< DoublereferenceDir_p
 
ScalarColumn< IntsourceId_p
 
ScalarColumn< BoolflagRow_p
 
ScalarColumn< IntephemerisId_p
 
ScalarMeasColumn< MEpochtimeMeas_p
 
ArrayMeasColumn< MDirectiondelayDirMeas_p
 
ArrayMeasColumn< MDirectionphaseDirMeas_p
 
ArrayMeasColumn< MDirectionreferenceDirMeas_p
 
ScalarQuantColumn< DoubletimeQuant_p
 

Detailed Description

A class to provide easy access to MSField columns

Intended use:

Public interface

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.

Definition at line 87 of file MSFieldColumns.h.

Constructor & Destructor Documentation

◆ MSFieldColumns() [1/3]

casacore::MSFieldColumns::MSFieldColumns ( const MSField msField)

Construct from the supplied Table.

◆ ~MSFieldColumns()

casacore::MSFieldColumns::~MSFieldColumns ( )

The desctructor does nothing special.

◆ MSFieldColumns() [2/3]

casacore::MSFieldColumns::MSFieldColumns ( )
protected

◆ MSFieldColumns() [3/3]

casacore::MSFieldColumns::MSFieldColumns ( const MSFieldColumns )
private

Member Function Documentation

◆ attach()

void casacore::MSFieldColumns::attach ( const MSField msField)
protected

◆ attachOptionalCols()

void casacore::MSFieldColumns::attachOptionalCols ( const MSField msField)
private

◆ code() [1/2]

ScalarColumn<String>& casacore::MSFieldColumns::code ( )
inline

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.

Definition at line 103 of file MSFieldColumns.h.

References code_p.

◆ code() [2/2]

const ScalarColumn<String>& casacore::MSFieldColumns::code ( ) const
inline

Const access to required columns.

Definition at line 124 of file MSFieldColumns.h.

References code_p.

◆ delayDir() [1/2]

ArrayColumn<Double>& casacore::MSFieldColumns::delayDir ( )
inline

Definition at line 104 of file MSFieldColumns.h.

References delayDir_p.

◆ delayDir() [2/2]

const ArrayColumn<Double>& casacore::MSFieldColumns::delayDir ( ) const
inline

Definition at line 125 of file MSFieldColumns.h.

References delayDir_p.

◆ delayDirMeas()

MDirection casacore::MSFieldColumns::delayDirMeas ( rownr_t  row,
Double  time = 0 
) const

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

or, if there is an ephemeris, the position at the time origin of the ephemeris.

If there is an ephemeris attached to a field table row, the nominal values of the direction columns are interpreted as an offset to the ephemeris. So if there is an ephemeris attached (EPHEMERIS_ID column contains value > -1), then the direction returned by delayDirMeas, phaseDirMeas, and referenceDirMeas is the ephemeris direction plus the offset taken from the corresponding direction column. This permits the convinient implementation of mosaics where several field table rows share one ephemeris and use different offsets in each row to create the mosaic pattern.

The unaltered ephemeris direction can be queried with the method ephemerisDirMeas(). If there is no ephemeris attached, ephemerisDirMeas() will return the same as referenceDirMeas().

In addtion to the directions, if there is an ephemeris available, also the radial velocity and the distance rho can be accessed.

The method needInterTime returns True if there is a polynomial or ephemeris connected to this field table row, and an interpolation time value should be provided. The method ephemPath returns the absolute path to the ephemeris table connected to the field table row, an empty string if there is none.

◆ delayDirMeasCol() [1/2]

ArrayMeasColumn<MDirection>& casacore::MSFieldColumns::delayDirMeasCol ( )
inline

Definition at line 105 of file MSFieldColumns.h.

References delayDirMeas_p.

◆ delayDirMeasCol() [2/2]

const ArrayMeasColumn<MDirection>& casacore::MSFieldColumns::delayDirMeasCol ( ) const
inline

Definition at line 126 of file MSFieldColumns.h.

References delayDirMeas_p.

◆ ephemerisDirMeas()

MDirection casacore::MSFieldColumns::ephemerisDirMeas ( rownr_t  row,
Double  time = 0 
) const

◆ ephemerisId() [1/2]

ScalarColumn<Int>& casacore::MSFieldColumns::ephemerisId ( )
inline

Access to optional columns.

Definition at line 145 of file MSFieldColumns.h.

References ephemerisId_p.

◆ ephemerisId() [2/2]

const ScalarColumn<Int>& casacore::MSFieldColumns::ephemerisId ( ) const
inline

Const access to optional columns.

Definition at line 150 of file MSFieldColumns.h.

References ephemerisId_p.

◆ ephemPath()

String casacore::MSFieldColumns::ephemPath ( rownr_t  row) const

◆ extractDirMeas()

MDirection casacore::MSFieldColumns::extractDirMeas ( const MDirection offsetDir,
Int  index,
Double interTime,
MEpoch  originEpoch 
) const
private

Extract the direction Measure from the corresponding ephemeris using the nominal position as an offset.

Note that interTime is assumed to use the same time reference frame as originEpoch.

◆ flagRow() [1/2]

ScalarColumn<Bool>& casacore::MSFieldColumns::flagRow ( )
inline

Definition at line 107 of file MSFieldColumns.h.

References flagRow_p.

◆ flagRow() [2/2]

const ScalarColumn<Bool>& casacore::MSFieldColumns::flagRow ( ) const
inline

Definition at line 128 of file MSFieldColumns.h.

References flagRow_p.

◆ getMJDs()

void casacore::MSFieldColumns::getMJDs ( Double originMJD,
Double interMJD,
const Double  interTime,
const MEpoch  originEpoch 
) const
private

◆ interpolateDirMeas()

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

Interpolate the direction Measure polynomial.

◆ matchDelayDir()

Bool casacore::MSFieldColumns::matchDelayDir ( rownr_t  row,
const MVDirection dirVal,
const Double sepInRad,
MVDirection mvdir,
Double  time = 0 
) const
private

◆ matchDirection()

Int64 casacore::MSFieldColumns::matchDirection ( const MDirection referenceDirection,
const MDirection delayDirection,
const MDirection phaseDirection,
const Quantum< Double > &  maxSeparation,
Int64  tryRow = -1,
Double  time = 0 
)

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.

◆ matchPhaseDir()

Bool casacore::MSFieldColumns::matchPhaseDir ( rownr_t  row,
const MVDirection dirVal,
const Double sepInRad,
MVDirection mvdir,
Double  time = 0 
) const
private

◆ matchReferenceDir()

Bool casacore::MSFieldColumns::matchReferenceDir ( rownr_t  row,
const MVDirection dirVal,
const Double sepInRad,
MVDirection mvdir,
Double  time = 0 
) const
private

◆ measCometIndex()

Int casacore::MSFieldColumns::measCometIndex ( rownr_t  row) const
private

◆ name() [1/2]

ScalarColumn<String>& casacore::MSFieldColumns::name ( )
inline

Definition at line 108 of file MSFieldColumns.h.

References name_p.

◆ name() [2/2]

const ScalarColumn<String>& casacore::MSFieldColumns::name ( ) const
inline

Definition at line 129 of file MSFieldColumns.h.

References name_p.

◆ needInterTime()

Bool casacore::MSFieldColumns::needInterTime ( rownr_t  row) const

◆ nrow()

rownr_t casacore::MSFieldColumns::nrow ( ) const
inline

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

Definition at line 214 of file MSFieldColumns.h.

References name_p.

◆ numPoly() [1/2]

ScalarColumn<Int>& casacore::MSFieldColumns::numPoly ( )
inline

Definition at line 109 of file MSFieldColumns.h.

References numPoly_p.

◆ numPoly() [2/2]

const ScalarColumn<Int>& casacore::MSFieldColumns::numPoly ( ) const
inline

Definition at line 130 of file MSFieldColumns.h.

References numPoly_p.

◆ operator=()

MSFieldColumns& casacore::MSFieldColumns::operator= ( const MSFieldColumns )
private

◆ phaseDir() [1/2]

ArrayColumn<Double>& casacore::MSFieldColumns::phaseDir ( )
inline

Definition at line 110 of file MSFieldColumns.h.

References phaseDir_p.

◆ phaseDir() [2/2]

const ArrayColumn<Double>& casacore::MSFieldColumns::phaseDir ( ) const
inline

Definition at line 131 of file MSFieldColumns.h.

References phaseDir_p.

◆ phaseDirMeas()

MDirection casacore::MSFieldColumns::phaseDirMeas ( rownr_t  row,
Double  time = 0 
) const

◆ phaseDirMeasCol() [1/2]

ArrayMeasColumn<MDirection>& casacore::MSFieldColumns::phaseDirMeasCol ( )
inline

Definition at line 111 of file MSFieldColumns.h.

References phaseDirMeas_p.

◆ phaseDirMeasCol() [2/2]

const ArrayMeasColumn<MDirection>& casacore::MSFieldColumns::phaseDirMeasCol ( ) const
inline

Definition at line 132 of file MSFieldColumns.h.

References phaseDirMeas_p.

◆ radVelMeas()

MRadialVelocity casacore::MSFieldColumns::radVelMeas ( rownr_t  row,
Double  time = 0 
) const

◆ referenceDir() [1/2]

ArrayColumn<Double>& casacore::MSFieldColumns::referenceDir ( )
inline

Definition at line 113 of file MSFieldColumns.h.

References referenceDir_p.

◆ referenceDir() [2/2]

const ArrayColumn<Double>& casacore::MSFieldColumns::referenceDir ( ) const
inline

Definition at line 134 of file MSFieldColumns.h.

References referenceDir_p.

◆ referenceDirMeas()

MDirection casacore::MSFieldColumns::referenceDirMeas ( rownr_t  row,
Double  time = 0 
) const

◆ referenceDirMeasCol() [1/2]

ArrayMeasColumn<MDirection>& casacore::MSFieldColumns::referenceDirMeasCol ( )
inline

Definition at line 114 of file MSFieldColumns.h.

References referenceDirMeas_p.

◆ referenceDirMeasCol() [2/2]

const ArrayMeasColumn<MDirection>& casacore::MSFieldColumns::referenceDirMeasCol ( ) const
inline

Definition at line 135 of file MSFieldColumns.h.

References referenceDirMeas_p.

◆ rho()

Quantity casacore::MSFieldColumns::rho ( rownr_t  row,
Double  time = 0 
) const

◆ setDirectionRef()

void casacore::MSFieldColumns::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.

◆ setEpochRef()

void casacore::MSFieldColumns::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;

◆ sourceId() [1/2]

ScalarColumn<Int>& casacore::MSFieldColumns::sourceId ( )
inline

Definition at line 116 of file MSFieldColumns.h.

References sourceId_p.

◆ sourceId() [2/2]

const ScalarColumn<Int>& casacore::MSFieldColumns::sourceId ( ) const
inline

Definition at line 137 of file MSFieldColumns.h.

References sourceId_p.

◆ time() [1/2]

ScalarColumn<Double>& casacore::MSFieldColumns::time ( )
inline

Definition at line 117 of file MSFieldColumns.h.

References time_p.

◆ time() [2/2]

const ScalarColumn<Double>& casacore::MSFieldColumns::time ( ) const
inline

Definition at line 138 of file MSFieldColumns.h.

References time_p.

◆ timeMeas() [1/2]

ScalarMeasColumn<MEpoch>& casacore::MSFieldColumns::timeMeas ( )
inline

Definition at line 119 of file MSFieldColumns.h.

References timeMeas_p.

◆ timeMeas() [2/2]

const ScalarMeasColumn<MEpoch>& casacore::MSFieldColumns::timeMeas ( ) const
inline

Definition at line 140 of file MSFieldColumns.h.

References timeMeas_p.

◆ timeQuant() [1/2]

ScalarQuantColumn<Double>& casacore::MSFieldColumns::timeQuant ( )
inline

Definition at line 118 of file MSFieldColumns.h.

References timeQuant_p.

◆ timeQuant() [2/2]

const ScalarQuantColumn<Double>& casacore::MSFieldColumns::timeQuant ( ) const
inline

Definition at line 139 of file MSFieldColumns.h.

References timeQuant_p.

◆ updateMeasComets()

void casacore::MSFieldColumns::updateMeasComets ( )

Update the MeasComets objects belonging to this FIELD table.

Needed when the entries in the EPHEMERIS_ID column have changed.

Member Data Documentation

◆ code_p

ScalarColumn<String> casacore::MSFieldColumns::code_p
private

Definition at line 291 of file MSFieldColumns.h.

Referenced by code().

◆ delayDir_p

ArrayColumn<Double> casacore::MSFieldColumns::delayDir_p
private

Definition at line 294 of file MSFieldColumns.h.

Referenced by delayDir().

◆ delayDirMeas_p

ArrayMeasColumn<MDirection> casacore::MSFieldColumns::delayDirMeas_p
private

Definition at line 304 of file MSFieldColumns.h.

Referenced by delayDirMeasCol().

◆ ephemerisId_p

ScalarColumn<Int> casacore::MSFieldColumns::ephemerisId_p
private

Definition at line 300 of file MSFieldColumns.h.

Referenced by ephemerisId().

◆ ephIdToMeasComet_p

std::map<Int, Int> casacore::MSFieldColumns::ephIdToMeasComet_p
private

Definition at line 287 of file MSFieldColumns.h.

◆ flagRow_p

ScalarColumn<Bool> casacore::MSFieldColumns::flagRow_p
private

Definition at line 298 of file MSFieldColumns.h.

Referenced by flagRow().

◆ measCometsPath_p

String casacore::MSFieldColumns::measCometsPath_p
private

Definition at line 285 of file MSFieldColumns.h.

◆ measCometsV_p

Vector<MeasComet*> casacore::MSFieldColumns::measCometsV_p
private

Definition at line 286 of file MSFieldColumns.h.

◆ name_p

ScalarColumn<String> casacore::MSFieldColumns::name_p
private

Definition at line 290 of file MSFieldColumns.h.

Referenced by name(), and nrow().

◆ numPoly_p

ScalarColumn<Int> casacore::MSFieldColumns::numPoly_p
private

Definition at line 293 of file MSFieldColumns.h.

Referenced by numPoly().

◆ phaseDir_p

ArrayColumn<Double> casacore::MSFieldColumns::phaseDir_p
private

Definition at line 295 of file MSFieldColumns.h.

Referenced by phaseDir().

◆ phaseDirMeas_p

ArrayMeasColumn<MDirection> casacore::MSFieldColumns::phaseDirMeas_p
private

Definition at line 305 of file MSFieldColumns.h.

Referenced by phaseDirMeasCol().

◆ referenceDir_p

ArrayColumn<Double> casacore::MSFieldColumns::referenceDir_p
private

Definition at line 296 of file MSFieldColumns.h.

Referenced by referenceDir().

◆ referenceDirMeas_p

ArrayMeasColumn<MDirection> casacore::MSFieldColumns::referenceDirMeas_p
private

Definition at line 306 of file MSFieldColumns.h.

Referenced by referenceDirMeasCol().

◆ sourceId_p

ScalarColumn<Int> casacore::MSFieldColumns::sourceId_p
private

Definition at line 297 of file MSFieldColumns.h.

Referenced by sourceId().

◆ time_p

ScalarColumn<Double> casacore::MSFieldColumns::time_p
private

Definition at line 292 of file MSFieldColumns.h.

Referenced by time().

◆ timeMeas_p

ScalarMeasColumn<MEpoch> casacore::MSFieldColumns::timeMeas_p
private

Definition at line 303 of file MSFieldColumns.h.

Referenced by timeMeas().

◆ timeQuant_p

ScalarQuantColumn<Double> casacore::MSFieldColumns::timeQuant_p
private

Definition at line 309 of file MSFieldColumns.h.

Referenced by timeQuant().


The documentation for this class was generated from the following file: