casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSMainColumns.h
Go to the documentation of this file.
00001 //# MSmainColumns.h: provides easy access to MeasurementSet main table columns
00002 //# Copyright (C) 2000
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 addressed 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 //# $Id: MSMainColumns.h 19944 2007-02-27 11:14:34Z Malte.Marquarding $
00027 
00028 #ifndef MS_MSMAINCOLUMNS_H
00029 #define MS_MSMAINCOLUMNS_H
00030 
00031 #include <casa/aips.h>
00032 #include <measures/Measures/MEpoch.h>
00033 #include <measures/Measures/Muvw.h>
00034 #include <measures/Measures/MCEpoch.h>
00035 #include <measures/Measures/MCuvw.h>
00036 #include <tables/Tables/ScalarColumn.h>
00037 #include <tables/Tables/ArrayColumn.h>
00038 #include <measures/TableMeasures/ScalarMeasColumn.h>
00039 #include <measures/TableMeasures/ScalarQuantColumn.h>
00040 #include <measures/TableMeasures/ArrayQuantColumn.h>
00041 
00042 namespace casa { //# NAMESPACE CASA - BEGIN
00043 
00044 class MeasurementSet;
00045 class String;
00046 template <class T> class Vector;
00047 
00048 // <summary>
00049 // A class for easy read-only access to MeasurementSet main table columns
00050 // </summary>
00051 
00052 // <use visibility=export>
00053 
00054 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
00055 // </reviewed>
00056 
00057 // <prerequisite>
00058 //   <li> MeasurementSet
00059 //   <li> ArrayColumn
00060 //   <li> ScalarColumn
00061 // </prerequisite>
00062 //
00063 // <etymology>
00064 // ROMSColumns stands for Read-Only MeasurementSet Table columns.
00065 // </etymology>
00066 //
00067 // <synopsis>
00068 // This class provides read-only access to the columns in the MeasurementSet.
00069 // It does the declaration of all the Scalar and ArrayColumns with the
00070 // correct types, so the application programmer doesn't have to
00071 // worry about getting those right. There is an access function
00072 // for every predefined column. Access to non-predefined columns will still
00073 // have to be done with explicit declarations.
00074 // <note role=warning> The Table that is used to construct this class must not
00075 // be destroyed (or go out of scope) before this class does. Otherwise the
00076 // scalar and array columns use by this class will be left dangling.</note>
00077 // </synopsis>
00078 // </synopsis>
00079 //
00080 // <example>
00081 // <srcblock>
00082 // // use as follows
00083 // MeasurementSet ms("myMS"); 
00084 // ROMSColumns msc(ms);
00085 // // show data from row 5
00086 // cout << msc.data()(5);
00087 // // show name of antenna on row 3 in antenna table
00088 // cout << msc.antenna().name();
00089 // </srcblock>
00090 // </example>
00091 //
00092 // <motivation>
00093 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
00094 // </motivation>
00095 //
00096 // <todo asof="1997/02/01">
00097 //   <li> We might decide to merge all the MSColumn classes with the
00098 //        corresponding MeasurementSet classes.
00099 // </todo>
00100 
00101 class ROMSMainColumns
00102 {
00103 public:
00104   // Create a columns object that accesses the data in the specified Table
00105   ROMSMainColumns(const MeasurementSet& ms);
00106 
00107   // The desctructor does nothing special
00108   ~ROMSMainColumns();
00109 
00110   // Access to required columns
00111   // <group>
00112   const ROScalarColumn<Int>& antenna1() const {return antenna1_p;}
00113   const ROScalarColumn<Int>& antenna2() const {return antenna2_p;}
00114   const ROScalarColumn<Int>& arrayId() const {return arrayId_p;}
00115   const ROScalarColumn<Int>& dataDescId() const {return dataDescId_p;}
00116   const ROScalarColumn<Double>& exposure() const {return exposure_p;}
00117   const ROScalarQuantColumn<Double>& exposureQuant() const { 
00118     return exposureQuant_p;}
00119   const ROScalarColumn<Int>& feed1() const {return feed1_p;}
00120   const ROScalarColumn<Int>& feed2() const {return feed2_p;}
00121   const ROScalarColumn<Int>& fieldId() const {return fieldId_p;}
00122   const ROArrayColumn<Bool>& flag() const {return flag_p;}
00123   const ROArrayColumn<Bool>& flagCategory() const {return flagCategory_p;}
00124   const ROScalarColumn<Bool>& flagRow() const {return flagRow_p;}
00125   const ROScalarColumn<Double>& interval() const {return interval_p;}
00126   const ROScalarQuantColumn<Double>& intervalQuant() const {
00127     return intervalQuant_p;}
00128   const ROScalarColumn<Int>& observationId() const {return observationId_p;}
00129   const ROScalarColumn<Int>& processorId() const {return processorId_p;}
00130   const ROScalarColumn<Int>& scanNumber() const {return scanNumber_p;}
00131   const ROArrayColumn<Float>& sigma() const {return sigma_p;}
00132   const ROScalarColumn<Int>& stateId() const {return stateId_p;}
00133   const ROScalarColumn<Double>& time() const {return time_p;}
00134   const ROScalarQuantColumn<Double>& timeQuant() const {
00135     return timeQuant_p;}
00136   const ROScalarMeasColumn<MEpoch>& timeMeas() const {
00137     return timeMeas_p;}
00138   const ROScalarColumn<Double>& timeCentroid() const {return timeCentroid_p;}
00139   const ROScalarQuantColumn<Double>& timeCentroidQuant() const {
00140     return timeCentroidQuant_p;}
00141   const ROScalarMeasColumn<MEpoch>& timeCentroidMeas() const {
00142     return timeCentroidMeas_p;}
00143   const ROArrayColumn<Double>& uvw() const {return uvw_p;}
00144   const ROArrayQuantColumn<Double>& uvwQuant() const {
00145     return uvwQuant_p;}
00146   const ROScalarMeasColumn<Muvw>& uvwMeas() const {
00147     return uvwMeas_p;}
00148   const ROArrayColumn<Float>& weight() const {return weight_p;}
00149   // </group>
00150 
00151   // Access to optional columns
00152   // <group>
00153   const ROScalarColumn<Int>& antenna3() const {return antenna3_p;}
00154   const ROScalarColumn<Bool>& baselineRef() const {return baselineRef_p;}
00155   const ROArrayColumn<Complex>& correctedData() const {return correctedData_p;}
00156   const ROArrayColumn<Complex>& data() const {return data_p;}
00157   const ROScalarColumn<Int>& feed3() const {return feed3_p;}
00158   const ROArrayColumn<Float>& floatData() const {return floatData_p;}
00159   const ROArrayColumn<Complex>& lagData() const {return lagData_p;}
00160   const ROArrayColumn<Complex>& modelData() const {return modelData_p;}
00161   const ROScalarColumn<Int>& phaseId() const {return phaseId_p;}
00162   const ROScalarColumn<Int>& pulsarBin() const {return pulsarBin_p;}
00163   const ROScalarColumn<Int>& pulsarGateId() const {return pulsarGateId_p;}
00164   const ROArrayColumn<Float>& sigmaSpectrum() const {return sigmaSpectrum_p;}
00165   const ROScalarColumn<Double>& timeExtraPrec() const {return timeExtraPrec_p;}
00166   const ROScalarQuantColumn<Double>& timeExtraPrecQuant() const {
00167     return timeExtraPrecQuant_p;}
00168   const ROArrayColumn<Double>& uvw2() const {return uvw2_p;}
00169   const ROScalarMeasColumn<Muvw>& uvw2Meas() const {
00170     return uvw2Meas_p;}
00171   const ROArrayQuantColumn<Double>& uvw2Quant() const {
00172     return uvw2Quant_p;}
00173   const ROArrayColumn<Complex>& videoPoint() const {return videoPoint_p;}
00174   const ROArrayColumn<Float>& weightSpectrum() const {return weightSpectrum_p;}
00175   // </group>
00176 
00177   // Convenience function that returns the number of rows in any of the columns
00178   uInt nrow() const {return antenna1_p.nrow();}
00179   
00180   // Returns the category labels for the FLAG_CATEGORY column.
00181   Vector<String> flagCategories() const;
00182 
00183 protected:
00184   //# default constructor creates a object that is not usable. Use the attach
00185   //# function correct this.
00186   ROMSMainColumns();
00187 
00188   //# attach this object to the supplied table.
00189   void attach(const MeasurementSet& ms);
00190 
00191 private:
00192   //# Make the assignment operator and the copy constructor private to prevent
00193   //# any compiler generated one from being used.
00194   ROMSMainColumns(const ROMSMainColumns&);
00195   ROMSMainColumns& operator=(const ROMSMainColumns&);
00196 
00197   //# Check if any optional columns exist and if so attach them.
00198   void attachOptionalCols(const MeasurementSet& ms);
00199   
00200   //# required columns
00201   ROScalarColumn<Int> antenna1_p;
00202   ROScalarColumn<Int> antenna2_p;
00203   ROScalarColumn<Int> arrayId_p;
00204   ROScalarColumn<Int> dataDescId_p;
00205   ROScalarColumn<Double> exposure_p;
00206   ROScalarColumn<Int> feed1_p;
00207   ROScalarColumn<Int> feed2_p;
00208   ROScalarColumn<Int> fieldId_p;
00209   ROArrayColumn<Bool> flag_p;
00210   ROArrayColumn<Bool> flagCategory_p;
00211   ROScalarColumn<Bool> flagRow_p;
00212   ROScalarColumn<Double> interval_p;
00213   ROScalarColumn<Int> observationId_p;
00214   ROScalarColumn<Int> processorId_p;
00215   ROScalarColumn<Int> scanNumber_p;
00216   ROArrayColumn<Float> sigma_p;
00217   ROScalarColumn<Int> stateId_p;
00218   ROScalarColumn<Double> time_p;
00219   ROScalarColumn<Double> timeCentroid_p;
00220   ROArrayColumn<Double> uvw_p;
00221   ROArrayColumn<Float> weight_p;
00222   //# optional columns
00223   ROScalarColumn<Int> antenna3_p;
00224   ROScalarColumn<Bool> baselineRef_p;
00225   ROArrayColumn<Complex> data_p;
00226   ROScalarColumn<Int> feed3_p;
00227   ROArrayColumn<Float> floatData_p;
00228   ROArrayColumn<Complex> lagData_p;
00229   ROScalarColumn<Int> phaseId_p;
00230   ROScalarColumn<Int> pulsarBin_p;
00231   ROScalarColumn<Int> pulsarGateId_p;
00232   ROArrayColumn<Float> sigmaSpectrum_p;
00233   ROScalarColumn<Double> timeExtraPrec_p;
00234   ROArrayColumn<Double> uvw2_p;
00235   ROArrayColumn<Complex> videoPoint_p;
00236   ROArrayColumn<Float> weightSpectrum_p;
00237 
00238   //# columns required for synthesis applications - all optional
00239   ROArrayColumn<Complex> correctedData_p;
00240   ROArrayColumn<Complex> modelData_p;
00241 
00242   //# Access to Measure columns
00243   ROScalarMeasColumn<MEpoch> timeMeas_p;
00244   ROScalarMeasColumn<MEpoch> timeCentroidMeas_p;
00245   ROScalarMeasColumn<Muvw> uvwMeas_p;
00246   //# optional Measure columns
00247   ROScalarMeasColumn<Muvw> uvw2Meas_p;
00248 
00249   //# Access to Quantum columns
00250   ROScalarQuantColumn<Double> exposureQuant_p;
00251   ROScalarQuantColumn<Double> intervalQuant_p;
00252   ROScalarQuantColumn<Double> timeQuant_p;
00253   ROScalarQuantColumn<Double> timeCentroidQuant_p;
00254   ROArrayQuantColumn<Double> uvwQuant_p;
00255   //# optional Quantum columns
00256   ROScalarQuantColumn<Double> timeExtraPrecQuant_p;
00257   ROArrayQuantColumn<Double> uvw2Quant_p;
00258 
00259 };
00260 
00261 // <summary>
00262 // A class for easy read-write access to MeasurementSet main table columns
00263 // </summary>
00264 
00265 // <use visibility=export>
00266 
00267 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
00268 // </reviewed>
00269 
00270 // <prerequisite>
00271 //   <li> MeasurementSet
00272 //   <li> ArrayColumn
00273 //   <li> ScalarColumn
00274 // </prerequisite>
00275 //
00276 // <etymology>
00277 // MSMainColumns stands for MeasurementSet main Table columns.
00278 // </etymology>
00279 //
00280 // <synopsis>
00281 // This class provides access to the columns in the MeasurementSet.
00282 // It does the declaration of all the Scalar and ArrayColumns with the
00283 // correct types, so the application programmer doesn't have to
00284 // worry about getting those right. There is an access function
00285 // for every predefined column. Access to non-predefined columns will still
00286 // have to be done with explicit declarations.
00287 // <note role=warning> The Table that is used to construct this class must not
00288 // be destroyed (or go out of scope) before this class does. Otherwise the
00289 // scalar and array columns use by this class will be left dangling.</note>
00290 // </synopsis>
00291 // </synopsis>
00292 //
00293 // <example>
00294 // <srcblock>
00295 // // use as follows
00296 // MeasurementSet ms("myMS",Table::Update); 
00297 // MSColumns msc(ms);
00298 // // show data from row 5
00299 // cout << msc.data()(5);
00300 // // change name of antenna on row 3 in antenna table
00301 // msc.antenna().name().put(3,"NewAnt-3");
00302 // </srcblock>
00303 // </example>
00304 //
00305 // <motivation>
00306 // Having to type long lists of Scalar and Array column declarations gets
00307 // very tedious. This class attempts to relieve some of that tedium, while
00308 // at the same time concentrating all the declarations in one place,
00309 // making Type errors in the column declaration (only caught at run-time) less
00310 // probable. Type errors in the use of the columns is caught at compile
00311 // time.
00312 // </motivation>
00313 //
00314 // <todo asof="1997/02/01">
00315 //   <li> We might decide to merge this class with the MeasurementSet
00316 // </todo>
00317 
00318 class MSMainColumns: public ROMSMainColumns
00319 {
00320 public:
00321 
00322   // Create a columns object that accesses the data in the specified Table
00323   MSMainColumns(MeasurementSet& ms);
00324 
00325   // The desctructor does nothing special
00326   ~MSMainColumns();
00327 
00328   // Read-write access to required columns
00329   // <group>
00330   ScalarColumn<Int>& antenna1() {return antenna1_p;}
00331   ScalarColumn<Int>& antenna2() {return antenna2_p;}
00332   ScalarColumn<Int>& arrayId() {return arrayId_p;}
00333   ScalarColumn<Int>& dataDescId() {return dataDescId_p;}
00334   ScalarColumn<Double>& exposure() {return exposure_p;}
00335   ScalarQuantColumn<Double>& exposureQuant() { 
00336     return exposureQuant_p;}
00337   ScalarColumn<Int>& feed1() {return feed1_p;}
00338   ScalarColumn<Int>& feed2() {return feed2_p;}
00339   ScalarColumn<Int>& fieldId() {return fieldId_p;}
00340   ArrayColumn<Bool>& flag() {return flag_p;}
00341   ArrayColumn<Bool>& flagCategory() {return flagCategory_p;}
00342   ScalarColumn<Bool>& flagRow() {return flagRow_p;}
00343   ScalarColumn<Double>& interval() {return interval_p;}
00344   ScalarQuantColumn<Double>& intervalQuant() {
00345     return intervalQuant_p;}
00346   ScalarColumn<Int>& observationId() {return observationId_p;}
00347   ScalarColumn<Int>& processorId() {return processorId_p;}
00348   ScalarColumn<Int>& scanNumber() {return scanNumber_p;}
00349   ArrayColumn<Float>& sigma() {return sigma_p;}
00350   ScalarColumn<Int>& stateId() {return stateId_p;}
00351   ScalarColumn<Double>& time() {return time_p;}
00352   ScalarQuantColumn<Double>& timeQuant() {
00353     return timeQuant_p;}
00354   ScalarMeasColumn<MEpoch>& timeMeas() {
00355     return timeMeas_p;}
00356   ScalarColumn<Double>& timeCentroid() {return timeCentroid_p;}
00357   ScalarQuantColumn<Double>& timeCentroidQuant() {
00358     return timeCentroidQuant_p;}
00359   ScalarMeasColumn<MEpoch>& timeCentroidMeas() {
00360     return timeCentroidMeas_p;}
00361   ArrayColumn<Double>& uvw() {return uvw_p;}
00362   ArrayQuantColumn<Double>& uvwQuant() {
00363     return uvwQuant_p;}
00364   ScalarMeasColumn<Muvw>& uvwMeas() {
00365     return uvwMeas_p;}
00366   ArrayColumn<Float>& weight() {return weight_p;}
00367   // </group>
00368 
00369   // Read-write access to optional columns
00370   // <group>
00371   ScalarColumn<Int>& antenna3() {return antenna3_p;}
00372   ScalarColumn<Bool>& baselineRef() {return baselineRef_p;}
00373   ArrayColumn<Complex>& correctedData() {return correctedData_p;}
00374   ArrayColumn<Complex>& data() {return data_p;}
00375   ScalarColumn<Int>& feed3() {return feed3_p;}
00376   ArrayColumn<Float>& floatData() {return floatData_p;}
00377   ArrayColumn<Complex>& lagData() {return lagData_p;}
00378   ArrayColumn<Complex>& modelData() {return modelData_p;}
00379   ScalarColumn<Int>& phaseId() {return phaseId_p;}
00380   ScalarColumn<Int>& pulsarBin() {return pulsarBin_p;}
00381   ScalarColumn<Int>& pulsarGateId() {return pulsarGateId_p;}
00382   ArrayColumn<Float>& sigmaSpectrum() {return sigmaSpectrum_p;}
00383   ScalarColumn<Double>& timeExtraPrec() {return timeExtraPrec_p;}
00384   ScalarQuantColumn<Double>& timeExtraPrecQuant() {
00385     return timeExtraPrecQuant_p;}
00386   ArrayColumn<Double>& uvw2() {return uvw2_p;}
00387   ScalarMeasColumn<Muvw>& uvw2Meas() {
00388     return uvw2Meas_p;}
00389   ArrayQuantColumn<Double>& uvw2Quant() {
00390     return uvw2Quant_p;}
00391   ArrayColumn<Complex>& videoPoint() {return videoPoint_p;}
00392   ArrayColumn<Float>& weightSpectrum() {return weightSpectrum_p;}
00393   // </group>
00394 
00395   // Read-only access to required columns
00396   // <group>
00397   const ROScalarColumn<Int>& antenna1() const {
00398     return ROMSMainColumns::antenna1();}
00399   const ROScalarColumn<Int>& antenna2() const {
00400     return ROMSMainColumns::antenna2();}
00401   const ROScalarColumn<Int>& arrayId() const {
00402     return ROMSMainColumns::arrayId();}
00403   const ROScalarColumn<Int>& dataDescId() const {
00404     return ROMSMainColumns::dataDescId();}
00405   const ROScalarColumn<Double>& exposure() const {
00406     return ROMSMainColumns::exposure();}
00407   const ROScalarQuantColumn<Double>& exposureQuant() const { 
00408     return ROMSMainColumns::exposureQuant();}
00409   const ROScalarColumn<Int>& feed1() const {
00410     return ROMSMainColumns::feed1();}
00411   const ROScalarColumn<Int>& feed2() const {
00412     return ROMSMainColumns::feed2();}
00413   const ROScalarColumn<Int>& fieldId() const {
00414     return ROMSMainColumns::fieldId();}
00415   const ROArrayColumn<Bool>& flag() const {
00416     return ROMSMainColumns::flag();}
00417   const ROArrayColumn<Bool>& flagCategory() const {
00418     return ROMSMainColumns::flagCategory();}
00419   const ROScalarColumn<Bool>& flagRow() const {
00420     return ROMSMainColumns::flagRow();}
00421   const ROScalarColumn<Double>& interval() const {
00422     return ROMSMainColumns::interval();}
00423   const ROScalarQuantColumn<Double>& intervalQuant() const {
00424     return ROMSMainColumns::intervalQuant();}
00425   const ROScalarColumn<Int>& observationId() const {
00426     return ROMSMainColumns::observationId();}
00427   const ROScalarColumn<Int>& processorId() const {
00428     return ROMSMainColumns::processorId();}
00429   const ROScalarColumn<Int>& scanNumber() const {
00430     return ROMSMainColumns::scanNumber();}
00431   const ROArrayColumn<Float>& sigma() const {
00432     return ROMSMainColumns::sigma();}
00433   const ROScalarColumn<Int>& stateId() const {
00434     return ROMSMainColumns::stateId();}
00435   const ROScalarColumn<Double>& time() const {
00436     return ROMSMainColumns::time();}
00437   const ROScalarQuantColumn<Double>& timeQuant() const {
00438     return ROMSMainColumns::timeQuant();}
00439   const ROScalarMeasColumn<MEpoch>& timeMeas() const {
00440     return ROMSMainColumns::timeMeas();}
00441   const ROScalarColumn<Double>& timeCentroid() const {
00442     return ROMSMainColumns::timeCentroid();}
00443   const ROScalarQuantColumn<Double>& timeCentroidQuant() const {
00444     return ROMSMainColumns::timeCentroidQuant();}
00445   const ROScalarMeasColumn<MEpoch>& timeCentroidMeas() const {
00446     return ROMSMainColumns::timeCentroidMeas();}
00447   const ROArrayColumn<Double>& uvw() const {
00448     return ROMSMainColumns::uvw();}
00449   const ROArrayQuantColumn<Double>& uvwQuant() const {
00450     return ROMSMainColumns::uvwQuant();}
00451   const ROScalarMeasColumn<Muvw>& uvwMeas() const {
00452     return ROMSMainColumns::uvwMeas();}
00453   const ROArrayColumn<Float>& weight() const {
00454     return ROMSMainColumns::weight();}
00455   // </group>
00456 
00457   // Read-only access to optional columns
00458   // <group>
00459   const ROScalarColumn<Int>& antenna3() const {
00460     return ROMSMainColumns::antenna3();}
00461   const ROScalarColumn<Bool>& baselineRef() const {
00462     return ROMSMainColumns::baselineRef();}
00463   const ROArrayColumn<Complex>& correctedData() const {
00464     return ROMSMainColumns::correctedData();}
00465   const ROArrayColumn<Complex>& data() const {
00466     return ROMSMainColumns::data();}
00467   const ROScalarColumn<Int>& feed3() const {
00468     return ROMSMainColumns::feed3();}
00469   const ROArrayColumn<Float>& floatData() const {
00470     return ROMSMainColumns::floatData();}
00471   const ROArrayColumn<Complex>& lagData() const {
00472     return ROMSMainColumns::lagData();}
00473   const ROArrayColumn<Complex>& modelData() const {
00474     return ROMSMainColumns::modelData();}
00475   const ROScalarColumn<Int>& phaseId() const {
00476     return ROMSMainColumns::phaseId();}
00477   const ROScalarColumn<Int>& pulsarBin() const {
00478     return ROMSMainColumns::pulsarBin();}
00479   const ROScalarColumn<Int>& pulsarGateId() const {
00480     return ROMSMainColumns::pulsarGateId();}
00481   const ROArrayColumn<Float>& sigmaSpectrum() const {
00482     return ROMSMainColumns::sigmaSpectrum();}
00483   const ROScalarColumn<Double>& timeExtraPrec() const {
00484     return ROMSMainColumns::timeExtraPrec();}
00485   const ROScalarQuantColumn<Double>& timeExtraPrecQuant() const {
00486     return ROMSMainColumns::timeExtraPrecQuant();}
00487   const ROArrayColumn<Double>& uvw2() const {
00488     return ROMSMainColumns::uvw2();}
00489   const ROScalarMeasColumn<Muvw>& uvw2Meas() const {
00490     return ROMSMainColumns::uvw2Meas();}
00491   const ROArrayQuantColumn<Double>& uvw2Quant() const {
00492     return ROMSMainColumns::uvw2Quant();}
00493   const ROArrayColumn<Complex>& videoPoint() const {
00494     return ROMSMainColumns::videoPoint();}
00495   const ROArrayColumn<Float>& weightSpectrum() const {
00496     return ROMSMainColumns::weightSpectrum();}
00497   // </group>
00498 
00499   // set the epoch type for the TIME and TIME_CENTROID columns. 
00500   // <note role=tip>
00501   // In principle this function can only be used if the table is empty,
00502   // otherwise already written values may thereafter have an incorrect
00503   // reference, offset, or unit.  However, it is possible that part of the
00504   // table gets written before these values are known.  In that case the
00505   // reference, offset, or units can be set by using a False
00506   // <src>tableMustBeEmpty</src> argument.
00507   // </note>
00508   void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
00509 
00510   // set the UVW reference type for the UVW and UVW2 (if defined) columns. This
00511   // can only be done when the table has no rows. Trying to do so at other
00512   // times will throw an exception.
00513   void setUVWRef(Muvw::Types ref);
00514 
00515   // Set the flag category labels to the supplied values (in the CATEGORY
00516   // keyword of the FLAG_CATEGORY column). Throws an exception, when compiled
00517   // in Debug mode, if the length of the supplied Vector is not the same as the
00518   // length of the third dimension of the FLAG_CATEGORY column.
00519   void setFlagCategories(const Vector<String>& categories);
00520 
00521 protected:
00522   //# default constructor creates a object that is not usable. Use the attach
00523   //# function correct this.
00524   MSMainColumns();
00525 
00526   //# attach this object to the supplied table.
00527   void attach(MeasurementSet& ms);
00528 
00529 private:
00530   //# Make the assignment operator and the copy constructor private to prevent
00531   //# any compiler generated one from being used.
00532   MSMainColumns(const MSMainColumns&);
00533   MSMainColumns& operator=(const MSMainColumns&);
00534 
00535   //# Check if any optional columns exist and if so attach them.
00536   void attachOptionalCols(MeasurementSet& ms);
00537   
00538   //# required columns
00539   ScalarColumn<Int> antenna1_p;
00540   ScalarColumn<Int> antenna2_p;
00541   ScalarColumn<Int> arrayId_p;
00542   ScalarColumn<Int> dataDescId_p;
00543   ScalarColumn<Double> exposure_p;
00544   ScalarColumn<Int> feed1_p;
00545   ScalarColumn<Int> feed2_p;
00546   ScalarColumn<Int> fieldId_p;
00547   ArrayColumn<Bool> flag_p;
00548   ArrayColumn<Bool> flagCategory_p;
00549   ScalarColumn<Bool> flagRow_p;
00550   ScalarColumn<Double> interval_p;
00551   ScalarColumn<Int> observationId_p;
00552   ScalarColumn<Int> processorId_p;
00553   ScalarColumn<Int> scanNumber_p;
00554   ArrayColumn<Float> sigma_p;
00555   ScalarColumn<Int> stateId_p;
00556   ScalarColumn<Double> time_p;
00557   ScalarColumn<Double> timeCentroid_p;
00558   ArrayColumn<Double> uvw_p;
00559   ArrayColumn<Float> weight_p;
00560   //# optional columns
00561   ScalarColumn<Int> antenna3_p;
00562   ScalarColumn<Bool> baselineRef_p;
00563   ArrayColumn<Complex> data_p;
00564   ScalarColumn<Int> feed3_p;
00565   ArrayColumn<Float> floatData_p;
00566   ArrayColumn<Complex> lagData_p;
00567   ScalarColumn<Int> phaseId_p;
00568   ScalarColumn<Int> pulsarBin_p;
00569   ScalarColumn<Int> pulsarGateId_p;
00570   ArrayColumn<Float> sigmaSpectrum_p;
00571   ScalarColumn<Double> timeExtraPrec_p;
00572   ArrayColumn<Double> uvw2_p;
00573   ArrayColumn<Complex> videoPoint_p;
00574   ArrayColumn<Float> weightSpectrum_p;
00575 
00576   //# columns required for synthesis applications - all optional
00577   ArrayColumn<Complex> correctedData_p;
00578   ArrayColumn<Complex> modelData_p;
00579 
00580   //# Access to Measure columns
00581   ScalarMeasColumn<MEpoch> timeMeas_p;
00582   ScalarMeasColumn<MEpoch> timeCentroidMeas_p;
00583   ScalarMeasColumn<Muvw> uvwMeas_p;
00584   //# optional Measure columns
00585   ScalarMeasColumn<Muvw> uvw2Meas_p;
00586 
00587   //# Access to Quantum columns
00588   ScalarQuantColumn<Double> exposureQuant_p;
00589   ScalarQuantColumn<Double> intervalQuant_p;
00590   ScalarQuantColumn<Double> timeQuant_p;
00591   ScalarQuantColumn<Double> timeCentroidQuant_p;
00592   ArrayQuantColumn<Double> uvwQuant_p;
00593   //# optional Quantum columns
00594   ScalarQuantColumn<Double> timeExtraPrecQuant_p;
00595   ArrayQuantColumn<Double> uvw2Quant_p;
00596 
00597 };
00598 
00599 
00600 } //# NAMESPACE CASA - END
00601 
00602 #endif
00603 
00604