casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CalBuffer.h
Go to the documentation of this file.
00001 //# CalBuffer.h: Calibration table buffer
00002 //# Copyright (C) 1996,1997,1998,2001,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_CALBUFFER_H
00030 #define CALIBRATION_CALBUFFER_H
00031 
00032 #include <synthesis/CalTables/CalIterBase.h>
00033 #include <synthesis/CalTables/CalTable.h>
00034 #include <synthesis/CalTables/CalMainColumns.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary> 
00039 // CalBuffer: Calibration table buffer
00040 // </summary>
00041 
00042 // <use visibility=export>
00043 
00044 // <reviewed reviewer="" date="" tests="" demos="">
00045 
00046 // <prerequisite>
00047 //   <li> <linkto class="CalTable">CalTable</linkto> module
00048 //   <li> <linkto class="CalIterBase">CalIterBase</linkto> module
00049 // </prerequisite>
00050 //
00051 // <etymology>
00052 // From "calibration table" and "buffer"
00053 // </etymology>
00054 //
00055 // <synopsis>
00056 // The CalBuffer class holds a buffer, optinally connected to a 
00057 // calibration table iterator (as derived from CalIterBase). 
00058 // Specializations for baseline-based, time-variable and solvable 
00059 // VisJones calibration table formats are provided through 
00060 // inheritance.
00061 // </synopsis>
00062 //
00063 // <example>
00064 // <srcblock>
00065 // </srcblock>
00066 // </example>
00067 //
00068 // <motivation>
00069 // Encapsulate calibration table data buffers.
00070 // </motivation>
00071 //
00072 // <todo asof="01/08/01">
00073 // (i) Deal with non-standard columns.
00074 // </todo>
00075 
00076 class CalBuffer 
00077 {
00078  public:
00079   // Default constructor. No connection to an underlying
00080   // calibration table iterator in this case.
00081   CalBuffer();
00082 
00083   // Construct from a calibration table iterator. The calibration
00084   // buffer will remain synchronized with the iterator.
00085   CalBuffer (CalIterBase& calIter);
00086 
00087   // Default destructor
00088   virtual ~CalBuffer();
00089 
00090   // Invalidate the current calibration buffer. This signals
00091   // that a re-read is required as the iterator has advanced.
00092   virtual void invalidate();
00093 
00094   // Write the current buffer at the end of a specified cal table (NYI)
00095   virtual void append (CalTable& /*calTable*/) {};
00096 
00097   // Data field accessors
00098   Vector<Double>& time();
00099   //  Vector<MEpoch>& timeMeas();
00100   Vector<Double>& timeEP();
00101   Vector<Double>& interval();
00102   Vector<Int>& antenna1();
00103   Vector<Int>& feed1();
00104   Vector<Int>& fieldId();
00105   Vector<Int>& arrayId();
00106   Vector<Int>& obsId();
00107   Vector<Int>& scanNo();
00108   Vector<Int>& processorId();
00109   Vector<Int>& stateId();
00110   Vector<Int>& phaseId();
00111   Vector<Int>& pulsarBin();
00112   Vector<Int>& pulsarGateId();
00113   Vector<Int>& freqGrp();
00114   Vector<String>& freqGrpName();
00115   Vector<String>& fieldName();
00116   Vector<String>& fieldCode();
00117   Vector<String>& sourceName();
00118   Vector<String>& sourceCode();
00119   Vector<Int>& calGrp();
00120   Array<Complex>& gain();
00121   Array<Int>& refAnt();
00122   Array<Int>& refFeed();
00123   Array<Int>& refReceptor();
00124   Array<Double>& refFreq();
00125   Vector<Int>& measFreqRef();
00126   Array<Double>& refDir();
00127   Vector<Int>& measDirRef();
00128   Vector<Int>& calDescId();
00129   Vector<Int>& calHistoryId(); 
00130 
00131  protected:
00132 
00133  private:
00134   // True if connected to underlying iterator
00135   Bool connectedToIter_p;
00136 
00137   // Ptr to cal main columns accessor
00138   CalMainColumns* calMainCol_p;
00139 
00140   // Buffer fields
00141   Vector<Double> time_p;
00142   Vector<MEpoch> timeMeas_p;
00143   Vector<Double> timeEP_p;
00144   Vector<Double> interval_p;
00145   Vector<Int> antenna1_p;
00146   Vector<Int> feed1_p;
00147   Vector<Int> fieldId_p;
00148   Vector<Int> arrayId_p;
00149   Vector<Int> obsId_p;
00150   Vector<Int> scanNo_p;
00151   Vector<Int> processorId_p;
00152   Vector<Int> stateId_p;
00153   Vector<Int> phaseId_p;
00154   Vector<Int> pulsarBin_p;
00155   Vector<Int> pulsarGateId_p;
00156   Vector<Int> freqGrp_p;
00157   Vector<String> freqGrpName_p;
00158   Vector<String> fieldName_p;
00159   Vector<String> fieldCode_p;
00160   Vector<String> sourceName_p;
00161   Vector<String> sourceCode_p;
00162   Vector<Int> calGrp_p;
00163   Array<Complex> gain_p;
00164   Array<Int> refAnt_p;
00165   Array<Int> refFeed_p;
00166   Array<Int> refReceptor_p;
00167   Array<Double> refFreq_p;
00168   Vector<Int> measFreqRef_p;
00169   Array<Double> refDir_p;
00170   Vector<Int> measDirRef_p;
00171   Vector<Int> calDescId_p;
00172   Vector<Int> calHistoryId_p;
00173 
00174   // Buffer field status flags
00175   Bool timeOK_p;
00176   Bool timeMeasOK_p;
00177   Bool timeEPOK_p;
00178   Bool intervalOK_p;
00179   Bool antenna1OK_p;
00180   Bool feed1OK_p;
00181   Bool fieldIdOK_p;
00182   Bool arrayIdOK_p;
00183   Bool obsIdOK_p;
00184   Bool scanNoOK_p;
00185   Bool processorIdOK_p;
00186   Bool stateIdOK_p;
00187   Bool phaseIdOK_p;
00188   Bool pulsarBinOK_p;
00189   Bool pulsarGateIdOK_p;
00190   Bool freqGrpOK_p;
00191   Bool freqGrpNameOK_p;
00192   Bool fieldNameOK_p;
00193   Bool fieldCodeOK_p;
00194   Bool sourceNameOK_p;
00195   Bool sourceCodeOK_p;
00196   Bool calGrpOK_p;
00197   Bool gainOK_p;
00198   Bool refAntOK_p;
00199   Bool refFeedOK_p;
00200   Bool refReceptorOK_p;
00201   Bool refFreqOK_p;
00202   Bool measFreqRefOK_p;
00203   Bool refDirOK_p;
00204   Bool measDirRefOK_p;
00205   Bool calDescIdOK_p;
00206   Bool calHistoryIdOK_p;
00207 };
00208 
00209 
00210 } //# NAMESPACE CASA - END
00211 
00212 #endif
00213    
00214   
00215 
00216 
00217