casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CalMainColumns2.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_CALMAINCOLUMNS2_H
00030 #define CALIBRATION_CALMAINCOLUMNS2_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/CalTable2.h>
00044 #include <synthesis/MSVis/MSCalEnums.h>
00045 
00046 namespace casa { //# NAMESPACE CASA - BEGIN
00047 
00048 template<class T> 
00049 class CalMainColumns2 {
00050   public:
00051     // Construct from a calibration table
00052     CalMainColumns2 (CalTable2& calTable);
00053     
00054     // Default destructor
00055     virtual ~CalMainColumns2() {};
00056     
00057     // Read-write column accessors
00058     ScalarColumn<Double>& time() {return time_p;};
00059     ScalarMeasColumn<MEpoch>& timeMeas() {return timeMeas_p;};
00060     ScalarColumn<Double>& timeEP() {return timeEP_p;};
00061     ScalarQuantColumn<Double>& timeEPQuant() {return timeEPQuant_p;};
00062     ScalarColumn<Double>& interval() {return interval_p;};
00063     ScalarQuantColumn<Double>& intervalQuant() {return intervalQuant_p;};
00064     ScalarColumn<Int>& antenna1() {return antenna1_p;};
00065     ScalarColumn<Int>& feed1() {return feed1_p;};
00066     ScalarColumn<Int>& fieldId() {return fieldId_p;};
00067     ScalarColumn<Int>& arrayId() {return arrayId_p;};
00068     ScalarColumn<Int>& obsId() {return obsId_p;};
00069     ScalarColumn<Int>& scanNo() {return scanNo_p;};
00070     ScalarColumn<Int>& processorId() {return processorId_p;};
00071     ScalarColumn<Int>& stateId() {return stateId_p;};
00072     ScalarColumn<Int>& phaseId() {return phaseId_p;};
00073     ScalarColumn<Int>& pulsarBin() {return pulsarBin_p;};
00074     ScalarColumn<Int>& pulsarGateId() {return pulsarGateId_p;};
00075     ScalarColumn<Int>& freqGrp() {return freqGrp_p;};
00076     ScalarColumn<String>& freqGrpName() {return freqGrpName_p;};
00077     ScalarColumn<String>& fieldName() {return fieldName_p;};
00078     ScalarColumn<String>& fieldCode() {return fieldCode_p;};
00079     ScalarColumn<String>& sourceName() {return sourceName_p;};
00080     ScalarColumn<String>& sourceCode() {return sourceCode_p;};
00081     ScalarColumn<Int>& calGrp() {return calGrp_p;};
00082     //ArrayColumn<Complex>& gain() {return gain_p;};
00083     ArrayColumn<T>& gain() {return gain_p;};
00084     ArrayColumn<T>& solvePar() {return solvePar_p;};
00085     ArrayColumn<Int>& refAnt() {return refAnt_p;};
00086     ArrayColumn<Int>& refFeed() {return refFeed_p;};
00087     ArrayColumn<Int>& refReceptor() {return refReceptor_p;};
00088     ArrayColumn<Double>& refFreq() {return refFreq_p;};
00089     ArrayMeasColumn<MFrequency>& refFreqMeas() {return refFreqMeas_p;};
00090     ScalarColumn<Int>& measFreqRef() {return measFreqRef_p;};
00091     ArrayColumn<Double>& refDir() {return refDir_p;};
00092     ArrayMeasColumn<MDirection>& refDirMeas() {return refDirMeas_p;};
00093     ScalarColumn<Int>& measDirRef() {return measDirRef_p;};
00094     ScalarColumn<Int>& calDescId() {return calDescId_p;};
00095     ScalarColumn<Int>& calHistoryId() {return calHistoryId_p;}; 
00096     
00097   protected:
00098     // Prohibit public use of the null constructor, which
00099     // does not produce a usable object.
00100     CalMainColumns2() {};
00101     
00102     // Return a CalTable as a Table reference. Utilizes friendship
00103     // relationship with class CalTable.
00104     Table& asTable(CalTable2& calTable) {return calTable.calMainAsTable();}
00105     
00106     // Attach a table column accessor
00107     void attach (CalTable2& calTable, TableColumn& tabCol, 
00108                  MSCalEnums::colDef colEnum, const Bool& optional = False);
00109     void attach (CalTable2& calTable, ArrayMeasColumn<MEpoch>& tabCol, 
00110                  MSCalEnums::colDef colEnum, const Bool& optional = False);
00111     void attach (CalTable2& calTable, ArrayMeasColumn<MFrequency>& tabCol, 
00112                  MSCalEnums::colDef colEnum, const Bool& optional = False);
00113     void attach (CalTable2& calTable, ArrayMeasColumn<MDirection>& tabCol, 
00114                  MSCalEnums::colDef colEnum, const Bool& optional = False);
00115     void attach (CalTable2& calTable, ScalarMeasColumn<MEpoch>& tabCol, 
00116                  MSCalEnums::colDef colEnum, const Bool& optional = False);
00117     void attach (CalTable2& calTable, ScalarQuantColumn<Double>& tabCol, 
00118                  MSCalEnums::colDef colEnum, const Bool& optional = False);
00119     
00120   private:
00121     // Prohibit copy constructor and assignment operator 
00122     CalMainColumns2 (const CalMainColumns2&);
00123     CalMainColumns2& operator= (const CalMainColumns2&);
00124     
00125     // Private column accessors
00126     ScalarColumn<Double> time_p;
00127     ScalarMeasColumn<MEpoch> timeMeas_p;
00128     ScalarColumn<Double> timeEP_p;
00129     ScalarQuantColumn<Double> timeEPQuant_p;
00130     ScalarColumn<Double> interval_p;
00131     ScalarQuantColumn<Double> intervalQuant_p;
00132     ScalarColumn<Int> antenna1_p;
00133     ScalarColumn<Int> feed1_p;
00134     ScalarColumn<Int> fieldId_p;
00135     ScalarColumn<Int> arrayId_p;
00136     ScalarColumn<Int> obsId_p;
00137     ScalarColumn<Int> scanNo_p;
00138     ScalarColumn<Int> processorId_p;
00139     ScalarColumn<Int> stateId_p;
00140     ScalarColumn<Int> phaseId_p;
00141     ScalarColumn<Int> pulsarBin_p;
00142     ScalarColumn<Int> pulsarGateId_p;
00143     ScalarColumn<Int> freqGrp_p;
00144     ScalarColumn<String> freqGrpName_p;
00145     ScalarColumn<String> fieldName_p;
00146     ScalarColumn<String> fieldCode_p;
00147     ScalarColumn<String> sourceName_p;
00148     ScalarColumn<String> sourceCode_p;
00149     ScalarColumn<Int> calGrp_p;
00150     //ArrayColumn<Complex> gain_p;
00151     ArrayColumn<T> gain_p;
00152     ArrayColumn<T> solvePar_p;
00153     ArrayColumn<Int> refAnt_p;
00154     ArrayColumn<Int> refFeed_p;
00155     ArrayColumn<Int> refReceptor_p;
00156     ArrayColumn<Double> refFreq_p;
00157     ArrayMeasColumn<MFrequency> refFreqMeas_p;
00158     ScalarColumn<Int> measFreqRef_p;
00159     ArrayColumn<Double> refDir_p;
00160     ArrayMeasColumn<MDirection> refDirMeas_p;
00161     ScalarColumn<Int> measDirRef_p;
00162     ScalarColumn<Int> calDescId_p;
00163     ScalarColumn<Int> calHistoryId_p;
00164   };
00165 } //# NAMESPACE CASA - END
00166 
00167 #ifndef AIPS_NO_TEMPLATE_SRC
00168 #include <synthesis/CalTables/CalMainColumns2.tcc>
00169 #endif
00170 
00171 #endif