casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::MSFieldColumns Class Reference

A class to provide easy access to MSField columns. 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

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

Construct from the supplied Table.

casacore::MSFieldColumns::~MSFieldColumns ( )

The desctructor does nothing special.

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

Member Function Documentation

void casacore::MSFieldColumns::attach ( const MSField msField)
protected
void casacore::MSFieldColumns::attachOptionalCols ( const MSField msField)
private
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.

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

Const access to required columns.

Definition at line 124 of file MSFieldColumns.h.

References code_p.

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

Definition at line 104 of file MSFieldColumns.h.

References delayDir_p.

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

Definition at line 125 of file MSFieldColumns.h.

References delayDir_p.

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.

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

Definition at line 105 of file MSFieldColumns.h.

References delayDirMeas_p.

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

Definition at line 126 of file MSFieldColumns.h.

References delayDirMeas_p.

MDirection casacore::MSFieldColumns::ephemerisDirMeas ( rownr_t  row,
Double  time = 0 
) const
ScalarColumn<Int>& casacore::MSFieldColumns::ephemerisId ( )
inline

Access to optional columns.

Definition at line 145 of file MSFieldColumns.h.

References ephemerisId_p.

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

Const access to optional columns.

Definition at line 150 of file MSFieldColumns.h.

References ephemerisId_p.

String casacore::MSFieldColumns::ephemPath ( rownr_t  row) const
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.

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

Definition at line 107 of file MSFieldColumns.h.

References flagRow_p.

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

Definition at line 128 of file MSFieldColumns.h.

References flagRow_p.

void casacore::MSFieldColumns::getMJDs ( Double originMJD,
Double interMJD,
const Double  interTime,
const MEpoch  originEpoch 
) const
private
static MDirection casacore::MSFieldColumns::interpolateDirMeas ( const Array< MDirection > &  arrDir,
Int  numPoly,
Double  interTime,
Double  timeOrigin 
)
static

Interpolate the direction Measure polynomial.

Bool casacore::MSFieldColumns::matchDelayDir ( rownr_t  row,
const MVDirection dirVal,
const Double sepInRad,
MVDirection mvdir,
Double  time = 0 
) const
private
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.

Bool casacore::MSFieldColumns::matchPhaseDir ( rownr_t  row,
const MVDirection dirVal,
const Double sepInRad,
MVDirection mvdir,
Double  time = 0 
) const
private
Bool casacore::MSFieldColumns::matchReferenceDir ( rownr_t  row,
const MVDirection dirVal,
const Double sepInRad,
MVDirection mvdir,
Double  time = 0 
) const
private
Int casacore::MSFieldColumns::measCometIndex ( rownr_t  row) const
private
ScalarColumn<String>& casacore::MSFieldColumns::name ( )
inline

Definition at line 108 of file MSFieldColumns.h.

References name_p.

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

Definition at line 129 of file MSFieldColumns.h.

References name_p.

Bool casacore::MSFieldColumns::needInterTime ( rownr_t  row) const
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.

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

Definition at line 109 of file MSFieldColumns.h.

References numPoly_p.

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

Definition at line 130 of file MSFieldColumns.h.

References numPoly_p.

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

Definition at line 110 of file MSFieldColumns.h.

References phaseDir_p.

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

Definition at line 131 of file MSFieldColumns.h.

References phaseDir_p.

MDirection casacore::MSFieldColumns::phaseDirMeas ( rownr_t  row,
Double  time = 0 
) const
ArrayMeasColumn<MDirection>& casacore::MSFieldColumns::phaseDirMeasCol ( )
inline

Definition at line 111 of file MSFieldColumns.h.

References phaseDirMeas_p.

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

Definition at line 132 of file MSFieldColumns.h.

References phaseDirMeas_p.

MRadialVelocity casacore::MSFieldColumns::radVelMeas ( rownr_t  row,
Double  time = 0 
) const
ArrayColumn<Double>& casacore::MSFieldColumns::referenceDir ( )
inline

Definition at line 113 of file MSFieldColumns.h.

References referenceDir_p.

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

Definition at line 134 of file MSFieldColumns.h.

References referenceDir_p.

MDirection casacore::MSFieldColumns::referenceDirMeas ( rownr_t  row,
Double  time = 0 
) const
ArrayMeasColumn<MDirection>& casacore::MSFieldColumns::referenceDirMeasCol ( )
inline

Definition at line 114 of file MSFieldColumns.h.

References referenceDirMeas_p.

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

Definition at line 135 of file MSFieldColumns.h.

References referenceDirMeas_p.

Quantity casacore::MSFieldColumns::rho ( rownr_t  row,
Double  time = 0 
) const
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.

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;

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

Definition at line 116 of file MSFieldColumns.h.

References sourceId_p.

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

Definition at line 137 of file MSFieldColumns.h.

References sourceId_p.

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

Definition at line 117 of file MSFieldColumns.h.

References time_p.

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

Definition at line 138 of file MSFieldColumns.h.

References time_p.

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

Definition at line 119 of file MSFieldColumns.h.

References timeMeas_p.

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

Definition at line 140 of file MSFieldColumns.h.

References timeMeas_p.

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

Definition at line 118 of file MSFieldColumns.h.

References timeQuant_p.

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

Definition at line 139 of file MSFieldColumns.h.

References timeQuant_p.

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

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

Definition at line 291 of file MSFieldColumns.h.

Referenced by code().

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

Definition at line 294 of file MSFieldColumns.h.

Referenced by delayDir().

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

Definition at line 304 of file MSFieldColumns.h.

Referenced by delayDirMeasCol().

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

Definition at line 300 of file MSFieldColumns.h.

Referenced by ephemerisId().

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

Definition at line 287 of file MSFieldColumns.h.

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

Definition at line 298 of file MSFieldColumns.h.

Referenced by flagRow().

String casacore::MSFieldColumns::measCometsPath_p
private

Definition at line 285 of file MSFieldColumns.h.

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

Definition at line 286 of file MSFieldColumns.h.

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

Definition at line 290 of file MSFieldColumns.h.

Referenced by name(), and nrow().

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

Definition at line 293 of file MSFieldColumns.h.

Referenced by numPoly().

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

Definition at line 295 of file MSFieldColumns.h.

Referenced by phaseDir().

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

Definition at line 305 of file MSFieldColumns.h.

Referenced by phaseDirMeasCol().

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

Definition at line 296 of file MSFieldColumns.h.

Referenced by referenceDir().

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

Definition at line 306 of file MSFieldColumns.h.

Referenced by referenceDirMeasCol().

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

Definition at line 297 of file MSFieldColumns.h.

Referenced by sourceId().

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

Definition at line 292 of file MSFieldColumns.h.

Referenced by time().

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

Definition at line 303 of file MSFieldColumns.h.

Referenced by timeMeas().

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: