casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CalMainColumns.h
Go to the documentation of this file.
00001 //# CalMainColumns.h: Calibration table cal_main column access
00002 //# Copyright (C) 1996,1997,1998,2001,2002,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be adressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 //# $Id$
00028 
00029 #ifndef CALIBRATION_CALMAINCOLUMNS_H
00030 #define CALIBRATION_CALMAINCOLUMNS_H
00031 
00032 #include <casa/aips.h>
00033 #include <measures/Measures/MEpoch.h>
00034 #include <measures/Measures/MFrequency.h>
00035 #include <measures/Measures/MDirection.h>
00036 #include <tables/Tables/TableColumn.h>
00037 #include <tables/Tables/ScalarColumn.h>
00038 #include <tables/Tables/ArrayColumn.h>
00039 #include <measures/TableMeasures/TableMeasColumn.h>
00040 #include <measures/TableMeasures/ScalarMeasColumn.h>
00041 #include <measures/TableMeasures/ArrayMeasColumn.h>
00042 #include <measures/TableMeasures/ScalarQuantColumn.h>
00043 #include <synthesis/CalTables/CalTable.h>
00044 #include <synthesis/MSVis/MSCalEnums.h>
00045 
00046 namespace casa { //# NAMESPACE CASA - BEGIN
00047 
00048 // <summary> 
00049 // ROCalMainColumns: Read-only cal_main calibration table column access
00050 // </summary>
00051 
00052 // <use visibility=export>
00053 
00054 // <reviewed reviewer="" date="" tests="" demos="">
00055 
00056 // <prerequisite>
00057 //   <li> <linkto class="CalTable">CalTable</linkto> module
00058 // </prerequisite>
00059 //
00060 // <etymology>
00061 // From "read-only", "calibration main table" and "columns".
00062 // </etymology>
00063 //
00064 // <synopsis>
00065 // The ROCalMainColumns class allows read-only access to columns
00066 // in the main calibration table. Specializations for baseline-based,
00067 // time-variable and solvable VisJones calibration table record types
00068 // are provided through inheritance.
00069 // </etymology>
00070 //
00071 // <example>
00072 // <srcblock>
00073 // </srcblock>
00074 // </example>
00075 //
00076 // <motivation>
00077 // Encapsulate access to calibration table columns.
00078 // </motivation>
00079 //
00080 // <todo asof="01/07/01">
00081 // (i) Deal with non-standard columns.
00082 // </todo>
00083 
00084 class ROCalMainColumns 
00085 {
00086  public:
00087   // Construct from a calibration table
00088   ROCalMainColumns (const CalTable& calTable);
00089 
00090   // Default destructor
00091   virtual ~ROCalMainColumns() {};
00092 
00093   // Read-only column accessors
00094   const ROScalarColumn<Double>& time() const {return time_p;};
00095   const ROScalarMeasColumn<MEpoch>& timeMeas() const {return timeMeas_p;};
00096   const ROScalarColumn<Double>& timeEP() const {return timeEP_p;};
00097   const ROScalarQuantColumn<Double>& timeEPQuant() const 
00098     {return timeEPQuant_p;};
00099   const ROScalarColumn<Double>& interval() const {return interval_p;};
00100   const ROScalarQuantColumn<Double>& intervalQuant() const
00101     {return intervalQuant_p;};
00102   const ROScalarColumn<Int>& antenna1() const {return antenna1_p;};
00103   const ROScalarColumn<Int>& feed1() const {return feed1_p;};
00104   const ROScalarColumn<Int>& fieldId() const {return fieldId_p;};
00105   const ROScalarColumn<Int>& arrayId() const {return arrayId_p;};
00106   const ROScalarColumn<Int>& obsId() const {return obsId_p;};
00107   const ROScalarColumn<Int>& scanNo() const {return scanNo_p;};
00108   const ROScalarColumn<Int>& processorId() const {return processorId_p;};
00109   const ROScalarColumn<Int>& stateId() const {return stateId_p;};
00110   const ROScalarColumn<Int>& phaseId() const {return phaseId_p;};
00111   const ROScalarColumn<Int>& pulsarBin() const {return pulsarBin_p;};
00112   const ROScalarColumn<Int>& pulsarGateId() const {return pulsarGateId_p;};
00113   const ROScalarColumn<Int>& freqGrp() const {return freqGrp_p;};
00114   const ROScalarColumn<String>& freqGrpName() const {return freqGrpName_p;};
00115   const ROScalarColumn<String>& fieldName() const {return fieldName_p;};
00116   const ROScalarColumn<String>& fieldCode() const {return fieldCode_p;};
00117   const ROScalarColumn<String>& sourceName() const {return sourceName_p;};
00118   const ROScalarColumn<String>& sourceCode() const {return sourceCode_p;};
00119   const ROScalarColumn<Int>& calGrp() const {return calGrp_p;};
00120   const ROArrayColumn<Complex>& gain() const {return gain_p;};
00121   const ROArrayColumn<Int>& refAnt() const {return refAnt_p;};
00122   const ROArrayColumn<Int>& refFeed() const {return refFeed_p;};
00123   const ROArrayColumn<Int>& refReceptor() const {return refReceptor_p;};
00124   const ROArrayColumn<Double>& refFreq() const {return refFreq_p;};
00125   const ROArrayMeasColumn<MFrequency>& refFreqMeas() const 
00126     {return refFreqMeas_p;};
00127   const ROScalarColumn<Int>& measFreqRef() const {return measFreqRef_p;};
00128   const ROArrayColumn<Double>& refDir() const {return refDir_p;};
00129   const ROArrayMeasColumn<MDirection>& refDirMeas() const 
00130     {return refDirMeas_p;};
00131   const ROScalarColumn<Int>& measDirRef() const {return measDirRef_p;};
00132   const ROScalarColumn<Int>& calDescId() const {return calDescId_p;};
00133   const ROScalarColumn<Int>& calHistoryId() const {return calHistoryId_p;};
00134 
00135  protected:
00136   // Prohibit public use of the null constructor, which
00137   // does not produce a usable object.
00138   ROCalMainColumns() {};
00139 
00140   // Return a CalTable as a Table reference. Utilizes friendship
00141   // relationship with class CalTable.
00142   const Table& asTable(const CalTable& calTable) 
00143     {return calTable.calMainAsTable();}
00144 
00145   // Attach a table column accessor
00146   void attach (const CalTable& calTable, ROTableColumn& tabCol, 
00147                MSCalEnums::colDef colEnum, const Bool& optional = False);
00148   void attach (const CalTable& calTable, 
00149                ROArrayMeasColumn<MEpoch>& tabCol, 
00150                MSCalEnums::colDef colEnum, const Bool& optional = False);
00151   void attach (const CalTable& calTable, 
00152                ROArrayMeasColumn<MFrequency>& tabCol, 
00153                MSCalEnums::colDef colEnum, const Bool& optional = False);
00154   void attach (const CalTable& calTable, 
00155                ROArrayMeasColumn<MDirection>& tabCol, 
00156                MSCalEnums::colDef colEnum, const Bool& optional = False);
00157   void attach (const CalTable& calTable, ROScalarMeasColumn<MEpoch>& tabCol, 
00158                MSCalEnums::colDef colEnum, const Bool& optional = False);
00159   void attach (const CalTable& calTable, ROScalarQuantColumn<Double>& tabCol, 
00160                MSCalEnums::colDef colEnum, const Bool& optional = False);
00161 
00162  private:
00163   // Prohibit copy constructor and assignment operator 
00164   ROCalMainColumns (const ROCalMainColumns&);
00165   ROCalMainColumns& operator= (const ROCalMainColumns&);
00166 
00167   // Private column accessors
00168   ROScalarColumn<Double> time_p;
00169   ROScalarMeasColumn<MEpoch> timeMeas_p;
00170   ROScalarColumn<Double> timeEP_p;
00171   ROScalarQuantColumn<Double> timeEPQuant_p;
00172   ROScalarColumn<Double> interval_p;
00173   ROScalarQuantColumn<Double> intervalQuant_p;
00174   ROScalarColumn<Int> antenna1_p;
00175   ROScalarColumn<Int> feed1_p;
00176   ROScalarColumn<Int> fieldId_p;
00177   ROScalarColumn<Int> arrayId_p;
00178   ROScalarColumn<Int> obsId_p;
00179   ROScalarColumn<Int> scanNo_p;
00180   ROScalarColumn<Int> processorId_p;
00181   ROScalarColumn<Int> stateId_p;
00182   ROScalarColumn<Int> phaseId_p;
00183   ROScalarColumn<Int> pulsarBin_p;
00184   ROScalarColumn<Int> pulsarGateId_p;
00185   ROScalarColumn<Int> freqGrp_p;
00186   ROScalarColumn<String> freqGrpName_p;
00187   ROScalarColumn<String> fieldName_p;
00188   ROScalarColumn<String> fieldCode_p;
00189   ROScalarColumn<String> sourceName_p;
00190   ROScalarColumn<String> sourceCode_p;
00191   ROScalarColumn<Int> calGrp_p;
00192   ROArrayColumn<Complex> gain_p;
00193   ROArrayColumn<Int> refAnt_p;
00194   ROArrayColumn<Int> refFeed_p;
00195   ROArrayColumn<Int> refReceptor_p;
00196   ROArrayColumn<Double> refFreq_p;
00197   ROArrayMeasColumn<MFrequency> refFreqMeas_p;
00198   ROScalarColumn<Int> measFreqRef_p;
00199   ROArrayColumn<Double> refDir_p;
00200   ROArrayMeasColumn<MDirection> refDirMeas_p;
00201   ROScalarColumn<Int> measDirRef_p;
00202   ROScalarColumn<Int> calDescId_p;
00203   ROScalarColumn<Int> calHistoryId_p;
00204 };
00205 
00206 // <summary> 
00207 // CalMainColumns: Read-write cal_main calibration table column access
00208 // </summary>
00209 
00210 // <use visibility=export>
00211 
00212 // <reviewed reviewer="" date="" tests="" demos="">
00213 
00214 // <prerequisite>
00215 //   <li> <linkto class="CalTable">CalTable</linkto> module
00216 // </prerequisite>
00217 //
00218 // <etymology>
00219 // From "calibration main table" and "columns".
00220 // </etymology>
00221 //
00222 // <synopsis>
00223 // The CalMainColumns class allows read-write access to columns
00224 // in the main calibration table. Specializations for baseline-based,
00225 // time-variable and solvable VisJones calibration table record types
00226 // are provided through inheritance.
00227 // </etymology>
00228 //
00229 // <example>
00230 // <srcblock>
00231 // </srcblock>
00232 // </example>
00233 //
00234 // <motivation>
00235 // Encapsulate access to calibration table columns.
00236 // </motivation>
00237 //
00238 // <todo asof="01/07/01">
00239 // (i) Deal with non-standard columns.
00240 // </todo>
00241 
00242 class CalMainColumns 
00243 {
00244  public:
00245   // Construct from a calibration table
00246   CalMainColumns (CalTable& calTable);
00247 
00248   // Default destructor
00249   virtual ~CalMainColumns() {};
00250 
00251   // Read-write column accessors
00252   ScalarColumn<Double>& time() {return time_p;};
00253   ScalarMeasColumn<MEpoch>& timeMeas() {return timeMeas_p;};
00254   ScalarColumn<Double>& timeEP() {return timeEP_p;};
00255   ScalarQuantColumn<Double>& timeEPQuant() {return timeEPQuant_p;};
00256   ScalarColumn<Double>& interval() {return interval_p;};
00257   ScalarQuantColumn<Double>& intervalQuant() {return intervalQuant_p;};
00258   ScalarColumn<Int>& antenna1() {return antenna1_p;};
00259   ScalarColumn<Int>& feed1() {return feed1_p;};
00260   ScalarColumn<Int>& fieldId() {return fieldId_p;};
00261   ScalarColumn<Int>& arrayId() {return arrayId_p;};
00262   ScalarColumn<Int>& obsId() {return obsId_p;};
00263   ScalarColumn<Int>& scanNo() {return scanNo_p;};
00264   ScalarColumn<Int>& processorId() {return processorId_p;};
00265   ScalarColumn<Int>& stateId() {return stateId_p;};
00266   ScalarColumn<Int>& phaseId() {return phaseId_p;};
00267   ScalarColumn<Int>& pulsarBin() {return pulsarBin_p;};
00268   ScalarColumn<Int>& pulsarGateId() {return pulsarGateId_p;};
00269   ScalarColumn<Int>& freqGrp() {return freqGrp_p;};
00270   ScalarColumn<String>& freqGrpName() {return freqGrpName_p;};
00271   ScalarColumn<String>& fieldName() {return fieldName_p;};
00272   ScalarColumn<String>& fieldCode() {return fieldCode_p;};
00273   ScalarColumn<String>& sourceName() {return sourceName_p;};
00274   ScalarColumn<String>& sourceCode() {return sourceCode_p;};
00275   ScalarColumn<Int>& calGrp() {return calGrp_p;};
00276   ArrayColumn<Complex>& gain() {return gain_p;};
00277   ArrayColumn<Int>& refAnt() {return refAnt_p;};
00278   ArrayColumn<Int>& refFeed() {return refFeed_p;};
00279   ArrayColumn<Int>& refReceptor() {return refReceptor_p;};
00280   ArrayColumn<Double>& refFreq() {return refFreq_p;};
00281   ArrayMeasColumn<MFrequency>& refFreqMeas() {return refFreqMeas_p;};
00282   ScalarColumn<Int>& measFreqRef() {return measFreqRef_p;};
00283   ArrayColumn<Double>& refDir() {return refDir_p;};
00284   ArrayMeasColumn<MDirection>& refDirMeas() {return refDirMeas_p;};
00285   ScalarColumn<Int>& measDirRef() {return measDirRef_p;};
00286   ScalarColumn<Int>& calDescId() {return calDescId_p;};
00287   ScalarColumn<Int>& calHistoryId() {return calHistoryId_p;}; 
00288   
00289  protected:
00290   // Prohibit public use of the null constructor, which
00291   // does not produce a usable object.
00292   CalMainColumns() {};
00293 
00294   // Return a CalTable as a Table reference. Utilizes friendship
00295   // relationship with class CalTable.
00296   Table& asTable(CalTable& calTable) {return calTable.calMainAsTable();}
00297 
00298   // Attach a table column accessor
00299   void attach (CalTable& calTable, TableColumn& tabCol, 
00300                MSCalEnums::colDef colEnum, const Bool& optional = False);
00301   void attach (CalTable& calTable, ArrayMeasColumn<MEpoch>& tabCol, 
00302                MSCalEnums::colDef colEnum, const Bool& optional = False);
00303   void attach (CalTable& calTable, ArrayMeasColumn<MFrequency>& tabCol, 
00304                MSCalEnums::colDef colEnum, const Bool& optional = False);
00305   void attach (CalTable& calTable, ArrayMeasColumn<MDirection>& tabCol, 
00306                MSCalEnums::colDef colEnum, const Bool& optional = False);
00307   void attach (CalTable& calTable, ScalarMeasColumn<MEpoch>& tabCol, 
00308                MSCalEnums::colDef colEnum, const Bool& optional = False);
00309   void attach (CalTable& calTable, ScalarQuantColumn<Double>& tabCol, 
00310                MSCalEnums::colDef colEnum, const Bool& optional = False);
00311 
00312  private:
00313   // Prohibit copy constructor and assignment operator 
00314   CalMainColumns (const CalMainColumns&);
00315   CalMainColumns& operator= (const CalMainColumns&);
00316 
00317   // Private column accessors
00318   ScalarColumn<Double> time_p;
00319   ScalarMeasColumn<MEpoch> timeMeas_p;
00320   ScalarColumn<Double> timeEP_p;
00321   ScalarQuantColumn<Double> timeEPQuant_p;
00322   ScalarColumn<Double> interval_p;
00323   ScalarQuantColumn<Double> intervalQuant_p;
00324   ScalarColumn<Int> antenna1_p;
00325   ScalarColumn<Int> feed1_p;
00326   ScalarColumn<Int> fieldId_p;
00327   ScalarColumn<Int> arrayId_p;
00328   ScalarColumn<Int> obsId_p;
00329   ScalarColumn<Int> scanNo_p;
00330   ScalarColumn<Int> processorId_p;
00331   ScalarColumn<Int> stateId_p;
00332   ScalarColumn<Int> phaseId_p;
00333   ScalarColumn<Int> pulsarBin_p;
00334   ScalarColumn<Int> pulsarGateId_p;
00335   ScalarColumn<Int> freqGrp_p;
00336   ScalarColumn<String> freqGrpName_p;
00337   ScalarColumn<String> fieldName_p;
00338   ScalarColumn<String> fieldCode_p;
00339   ScalarColumn<String> sourceName_p;
00340   ScalarColumn<String> sourceCode_p;
00341   ScalarColumn<Int> calGrp_p;
00342   ArrayColumn<Complex> gain_p;
00343   ArrayColumn<Int> refAnt_p;
00344   ArrayColumn<Int> refFeed_p;
00345   ArrayColumn<Int> refReceptor_p;
00346   ArrayColumn<Double> refFreq_p;
00347   ArrayMeasColumn<MFrequency> refFreqMeas_p;
00348   ScalarColumn<Int> measFreqRef_p;
00349   ArrayColumn<Double> refDir_p;
00350   ArrayMeasColumn<MDirection> refDirMeas_p;
00351   ScalarColumn<Int> measDirRef_p;
00352   ScalarColumn<Int> calDescId_p;
00353   ScalarColumn<Int> calHistoryId_p;
00354 };
00355 
00356 
00357 } //# NAMESPACE CASA - END
00358 
00359 #endif
00360    
00361   
00362 
00363 
00364