casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CalDescColumns2.h
Go to the documentation of this file.
00001 //# CalDescColumns.h: Calibration table cal_desc 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_CALDESCCOLUMNS2_H
00030 #define CALIBRATION_CALDESCCOLUMNS2_H
00031 
00032 #include <casa/aips.h>
00033 #include <measures/Measures/MFrequency.h>
00034 #include <tables/Tables/TableColumn.h>
00035 #include <tables/Tables/ScalarColumn.h>
00036 #include <tables/Tables/ArrayColumn.h>
00037 #include <measures/TableMeasures/TableMeasColumn.h>
00038 #include <measures/TableMeasures/ScalarMeasColumn.h>
00039 #include <measures/TableMeasures/ArrayMeasColumn.h>
00040 #include <measures/TableMeasures/ArrayQuantColumn.h>
00041 #include <synthesis/CalTables/CalTable2.h>
00042 #include <synthesis/MSVis/MSCalEnums.h>
00043 
00044 namespace casa { //# NAMESPACE CASA - BEGIN
00045 
00046 // <summary> 
00047 // ROCalDescColumns: Read-only cal_desc calibration table column access
00048 // </summary>
00049 
00050 // <use visibility=export>
00051 
00052 // <reviewed reviewer="" date="" tests="" demos="">
00053 
00054 // <prerequisite>
00055 //   <li> <linkto class="CalTable">CalTable</linkto> module
00056 // </prerequisite>
00057 //
00058 // <etymology>
00059 // From "read-only", "calibration descriptor table" and "columns".
00060 // </etymology>
00061 //
00062 // <synopsis>
00063 // The ROCalDescColumns class allows read-only access to columns
00064 // in the cal_desc calibration sub-table. 
00065 // </etymology>
00066 //
00067 // <example>
00068 // <srcblock>
00069 // </srcblock>
00070 // </example>
00071 //
00072 // <motivation>
00073 // Encapsulate read-only access to cal_desc calibration sub-table columns.
00074 // </motivation>
00075 //
00076 // <todo asof="11/01/01">
00077 // (i) Deal with non-standard columns.
00078 // </todo>
00079 
00080 class ROCalDescColumns2 
00081 {
00082  public:
00083   // Construct from a cal_desc calibration sub-table
00084   ROCalDescColumns2 (const CalTable2& calTable);
00085 
00086   // Default destructor
00087   virtual ~ROCalDescColumns2() {};
00088 
00089   // Read-only column accessors
00090   const ROScalarColumn<Int>& numSpw() const {return numSpw_p;};
00091   const ROArrayColumn<Int>& numChan() const {return numChan_p;};
00092   const ROScalarColumn<Int>& numReceptors() const {return numReceptors_p;};
00093   const ROScalarColumn<Int>& nJones() const {return nJones_p;};
00094   const ROArrayColumn<Int>& spwId() const {return spwId_p;};
00095   const ROArrayColumn<Double>& chanFreq() const {return chanFreq_p;};
00096   const ROArrayMeasColumn<MFrequency>& chanFreqMeas() const 
00097     {return chanFreqMeas_p;};
00098   const ROScalarColumn<Int>& measFreqRef() const {return measFreqRef_p;};
00099   const ROArrayColumn<Double>& chanWidth() const {return chanWidth_p;}
00100   const ROArrayQuantColumn<Double>& chanWidthQuant() const {
00101     return chanWidthQuant_p;}
00102   const ROArrayColumn<Int>& chanRange() const {return chanRange_p;}
00103   const ROArrayColumn<String>& polznType() const {return polznType_p;}
00104   const ROScalarColumn<String>& jonesType() const {return jonesType_p;};
00105   const ROScalarColumn<String>& msName() const {return msName_p;};
00106 
00107  protected:
00108   // Prohibit public use of the null constructor, which
00109   // does not produce a usable object.
00110   ROCalDescColumns2() {};
00111 
00112   // Return a CalTable cal_desc subtable as a Table reference. 
00113   // Utilizes friendship relationship with class CalTable.
00114   const Table& calDescAsTable(const CalTable2& calTable) 
00115     {return calTable.calDescAsTable();}
00116 
00117   // Attach a table column accessor
00118   void attach (const CalTable2& calTable, ROTableColumn& tabCol, 
00119                MSCalEnums::colDef colEnum, const Bool& optional = False);
00120   void attach (const CalTable2& calTable, ROTableMeasColumn& tabCol, 
00121                MSCalEnums::colDef colEnum, const Bool& optional = False);
00122   void attach (const CalTable2& calTable, ROArrayQuantColumn<Double>& tabCol, 
00123                MSCalEnums::colDef colEnum, const Bool& optional = False);
00124 
00125  private:
00126   // Prohibit copy constructor and assignment operator 
00127   ROCalDescColumns2 (const ROCalDescColumns2&);
00128   ROCalDescColumns2& operator= (const ROCalDescColumns2&);
00129 
00130   // Private column accessors
00131   ROScalarColumn<Int> numSpw_p;
00132   ROArrayColumn<Int> numChan_p;
00133   ROScalarColumn<Int> numReceptors_p;
00134   ROScalarColumn<Int> nJones_p;
00135   ROArrayColumn<Int> spwId_p;
00136   ROArrayColumn<Double> chanFreq_p;
00137   ROArrayMeasColumn<MFrequency> chanFreqMeas_p;
00138   ROScalarColumn<Int> measFreqRef_p;
00139   ROArrayColumn<Double> chanWidth_p;
00140   ROArrayQuantColumn<Double> chanWidthQuant_p;
00141   ROArrayColumn<Int> chanRange_p;
00142   ROArrayColumn<String> polznType_p;
00143   ROScalarColumn<String> jonesType_p;
00144   ROScalarColumn<String> msName_p;
00145 };
00146 
00147 // <summary> 
00148 // CalDescColumns2: Read-write cal_desc calibration table column access
00149 // </summary>
00150 
00151 // <use visibility=export>
00152 
00153 // <reviewed reviewer="" date="" tests="" demos="">
00154 
00155 // <prerequisite>
00156 //   <li> <linkto class="CalTable">CalTable</linkto> module
00157 // </prerequisite>
00158 //
00159 // <etymology>
00160 // From "calibration descriptor table" and "columns".
00161 // </etymology>
00162 //
00163 // <synopsis>
00164 // The CalDescColumns2 class allows read-write access to columns
00165 // in the cal_desc calibration sub-table. 
00166 // </etymology>
00167 //
00168 // <example>
00169 // <srcblock>
00170 // </srcblock>
00171 // </example>
00172 //
00173 // <motivation>
00174 // Encapsulate access to cal_desc calibration sub-table columns.
00175 // </motivation>
00176 //
00177 // <todo asof="01/07/01">
00178 // (i) Deal with non-standard columns.
00179 // </todo>
00180 
00181 class CalDescColumns2 
00182 {
00183  public:
00184   // Construct from a calibration table
00185   CalDescColumns2 (CalTable2& calTable);
00186 
00187   // Default destructor
00188   virtual ~CalDescColumns2() {};
00189 
00190   // Read-write column accessors
00191   ScalarColumn<Int>& numSpw() {return numSpw_p;};
00192   ArrayColumn<Int>& numChan() {return numChan_p;};
00193   ScalarColumn<Int>& numReceptors() {return numReceptors_p;};
00194   ScalarColumn<Int>& nJones() {return nJones_p;};
00195   ArrayColumn<Int>& spwId() {return spwId_p;};
00196   ArrayColumn<Double>& chanFreq() {return chanFreq_p;};
00197   ArrayMeasColumn<MFrequency>& chanFreqMeas() {return chanFreqMeas_p;};
00198   ScalarColumn<Int>& measFreqRef() {return measFreqRef_p;};
00199   ArrayColumn<Double>& chanWidth() {return chanWidth_p;}
00200   ArrayQuantColumn<Double>& chanWidthQuant() {return chanWidthQuant_p;}
00201   ArrayColumn<Int>& chanRange() {return chanRange_p;}
00202   ArrayColumn<String>& polznType() {return polznType_p;}
00203   ScalarColumn<String>& jonesType() {return jonesType_p;};
00204   ScalarColumn<String>& msName() {return msName_p;};
00205 
00206  protected:
00207   // Prohibit public use of the null constructor, which
00208   // does not produce a usable object.
00209   CalDescColumns2() {};
00210 
00211   // Return a CalTable cal_desc subtable as a Table reference. 
00212   // Utilizes friendship relationship with class CalTable.
00213   Table& calDescAsTable(CalTable2& calTable) {return calTable.calDescAsTable();}
00214 
00215   // Attach a table column accessor
00216   void attach (CalTable2& calTable, ROTableColumn& tabCol, 
00217                MSCalEnums::colDef colEnum, const Bool& optional = False);
00218   void attach (CalTable2& calTable, ROTableMeasColumn& tabCol, 
00219                MSCalEnums::colDef colEnum, const Bool& optional = False);
00220   void attach (CalTable2& calTable, ROArrayQuantColumn<Double>& tabCol, 
00221                MSCalEnums::colDef colEnum, const Bool& optional = False);
00222 
00223  private:
00224   // Prohibit copy constructor and assignment operator 
00225   CalDescColumns2 (const CalDescColumns2&);
00226   CalDescColumns2& operator= (const CalDescColumns2&);
00227 
00228   // Private column accessors
00229   ScalarColumn<Int> numSpw_p;
00230   ArrayColumn<Int> numChan_p;
00231   ScalarColumn<Int> numReceptors_p;
00232   ScalarColumn<Int> nJones_p;
00233   ArrayColumn<Int> spwId_p;
00234   ArrayColumn<Double> chanFreq_p;
00235   ArrayMeasColumn<MFrequency> chanFreqMeas_p;
00236   ScalarColumn<Int> measFreqRef_p;
00237   ArrayColumn<Double> chanWidth_p;
00238   ArrayQuantColumn<Double> chanWidthQuant_p;
00239   ArrayColumn<Int> chanRange_p;
00240   ArrayColumn<String> polznType_p;
00241   ScalarColumn<String> jonesType_p;
00242   ScalarColumn<String> msName_p;
00243 };
00244 
00245 
00246 } //# NAMESPACE CASA - END
00247 
00248 #endif
00249    
00250   
00251 
00252 
00253