casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SolvableVJMBuf.h
Go to the documentation of this file.
00001 //# SolvableVJMBuf.h: SolvableVisJones calibration main table buffer
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_SOLVABLEVJMBUF_H
00030 #define CALIBRATION_SOLVABLEVJMBUF_H
00031 
00032 #include <synthesis/CalTables/TimeVarVJMBuf.h>
00033 #include <synthesis/CalTables/SolvableVJMCol.h>
00034 #include <synthesis/CalTables/SolvableVJTable.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary> 
00039 // SolvableVisJonesMBuf: SolvableVisJones calibration main table buffer
00040 // </summary>
00041 
00042 // <use visibility=export>
00043 
00044 // <reviewed reviewer="" date="" tests="" demos="">
00045 
00046 // <prerequisite>
00047 // <li> <linkto class="CalMainBuffer">CalMainBuffer</linkto> module
00048 // <li> <linkto class="TimeVarVisJonesMBuf">TimeVarVisJonesMBuf</linkto> module
00049 // </prerequisite>
00050 //
00051 // <etymology>
00052 // From "solvable visibility Jones matrix", "cal main table" and "buffer"
00053 // </etymology>
00054 //
00055 // <synopsis>
00056 // The SolvableVisJonesMBuf class holds a buffer, optionally connected to a 
00057 // SolvableVisJones calibration main table iterator (of base type 
00058 // CalIterBase). Specializations for different solvable Jones matrix
00059 // types are provided through inheritance.
00060 // </synopsis>
00061 //
00062 // <example>
00063 // <srcblock>
00064 // </srcblock>
00065 // </example>
00066 //
00067 // <motivation>
00068 // Encapsulate SolvableVisJones calibration main table data buffers.
00069 // </motivation>
00070 //
00071 // <todo asof="01/08/01">
00072 // (i) Deal with non-standard columns.
00073 // </todo>
00074 
00075 class SolvableVisJonesMBuf : public TimeVarVisJonesMBuf
00076 {
00077  public:
00078   // Default constructor. No connection to an underlying
00079   // calibration table iterator in this case.
00080   SolvableVisJonesMBuf();
00081 
00082   // Construct from a set of calibration buffer indices and
00083   // their specified values. Non-index columns will be set 
00084   // to default values, and there is no connection to an 
00085   // underlying calibration table iterator in this case.
00086   SolvableVisJonesMBuf (const Vector<Int>& calIndices, 
00087                         const Block<Vector<Int> >& indexValues);
00088 
00089   // Construct from a calibration table iterator. The calibration
00090   // buffer will remain synchronized with the iterator.
00091   SolvableVisJonesMBuf (CalIterBase& calIter);
00092 
00093   // Write the current buffer at the end of a specified cal table;
00094   // returns the number of rows appended
00095   virtual Int append (CalTable& calTable);
00096 
00097   // Maximum number of rows in the calibration buffer
00098   virtual Int nRow();
00099 
00100   // Data field accessors
00101   virtual Vector<Bool>& totalSolnOk();
00102   virtual Vector<Float>& totalFit();
00103   virtual Vector<Float>& totalFitWgt();
00104   virtual Array<Bool>& solnOk();
00105   virtual Array<Float>& fit();
00106   virtual Array<Float>& fitWgt();
00107   virtual Array<Bool>& flag();
00108   virtual Array<Float>& snr();
00109 
00110  protected:
00111   // Factory method to create a columns accessor object of the appropriate type
00112   virtual SolvableVisJonesMCol* newCalMainCol (CalTable& calTable) {
00113     return new 
00114       SolvableVisJonesMCol(dynamic_cast<SolvableVisJonesTable&>(calTable));};
00115 
00116   // Calibration table columns accessor
00117   virtual SolvableVisJonesMCol* calMainCol() 
00118     {return dynamic_cast<SolvableVisJonesMCol*>(CalMainBuffer::calMainCol());};
00119 
00120   // Invalidate the current cache.
00121   virtual void invalidate();
00122 
00123   // <group>
00124   // Fill the cal buffer attribute columns in an empty cal buffer,
00125   // after the cal indices have been set using fillIndices(). The
00126   // cal indices, specified as enums from class MSCalEnums, are excluded
00127   // as non-attribute columns
00128   //
00129   // Use a visibility buffer to define the attribute values (NYI)
00130   virtual void fillAttributes(const Vector<Int>& /*calIndices*/,
00131                               const VisBuffer& /*vb*/) {};
00132   //
00133   // Set default attribute values
00134   virtual void fillAttributes(const Vector<Int>& calIndices);
00135   // </group>
00136 
00137  private:
00138   // Buffer fields
00139   Vector<Bool> totalSolnOk_p;
00140   Vector<Float> totalFit_p;
00141   Vector<Float> totalFitWgt_p;
00142   Array<Bool> solnOk_p;
00143   Array<Float> fit_p;
00144   Array<Float> fitWgt_p;
00145   Array<Bool> flag_p;
00146   Array<Float> snr_p;
00147 
00148   // Buffer field status flags
00149   Bool totalSolnOkOK_p;
00150   Bool totalFitOK_p;
00151   Bool totalFitWgtOK_p;
00152   Bool solnOkOK_p;
00153   Bool fitOK_p;
00154   Bool fitWgtOK_p;
00155   Bool flagOK_p;
00156   Bool snrOK_p;
00157 };
00158 
00159 // <summary> 
00160 // GJonesMBuf: GJones calibration main table buffer
00161 // </summary>
00162 
00163 // <use visibility=export>
00164 
00165 // <reviewed reviewer="" date="" tests="" demos="">
00166 
00167 // <prerequisite>
00168 // <li> <linkto class="CalMainBuffer">CalMainBuffer</linkto> module
00169 // <li> <linkto class="SolvableVisJonesMBuf">SolvableVisJonesMBuf</linkto> module
00170 // </prerequisite>
00171 //
00172 // <etymology>
00173 // From "GJones matrix", "cal main table" and "buffer"
00174 // </etymology>
00175 //
00176 // <synopsis>
00177 // The GJonesMBuf class holds a buffer, optionally connected to a 
00178 // GJones calibration main table iterator (of base type CalIterBase). 
00179 // The GJones matrix contains electronic gain correction terms.
00180 // </synopsis>
00181 //
00182 // <example>
00183 // <srcblock>
00184 // </srcblock>
00185 // </example>
00186 //
00187 // <motivation>
00188 // Encapsulate GJones calibration main table data buffers.
00189 // </motivation>
00190 //
00191 // <todo asof="01/08/01">
00192 // (i) Deal with non-standard columns.
00193 // </todo>
00194 
00195 class GJonesMBuf : public SolvableVisJonesMBuf
00196 {
00197  public:
00198   // Default constructor. No connection to an underlying
00199   // calibration table iterator in this case.
00200   GJonesMBuf();
00201 
00202   // Construct from a set of calibration buffer indices and
00203   // their specified values. Non-index columns will be set 
00204   // to default values, and there is no connection to an 
00205   // underlying calibration table iterator in this case.
00206   GJonesMBuf (const Vector<Int>& calIndices, 
00207               const Block<Vector<Int> >& indexValues);
00208 
00209   // Construct from a calibration table iterator. The calibration
00210   // buffer will remain synchronized with the iterator.
00211   GJonesMBuf (CalIterBase& calIter);
00212 
00213   // Update the calibration solution in each of a set of buffer rows
00214   virtual Bool fillMatchingRows (const Vector<Int>& matchingRows,
00215                                  const String& sFreqGrpName,
00216                                  const Complex& sGain,
00217                                  const MFrequency& sRefFreq,
00218                                  const Int& sRefAnt);
00219  protected:
00220 
00221  private:
00222 };
00223 
00224 // <summary> 
00225 // DJonesMBuf: DJones calibration main table buffer
00226 // </summary>
00227 
00228 // <use visibility=export>
00229 
00230 // <reviewed reviewer="" date="" tests="" demos="">
00231 
00232 // <prerequisite>
00233 // <li> <linkto class="CalMainBuffer">CalMainBuffer</linkto> module
00234 // <li> <linkto class="SolvableVisJonesMBuf">SolvableVisJonesMBuf</linkto> module
00235 // </prerequisite>
00236 //
00237 // <etymology>
00238 // From "DJones matrix", "cal main table" and "buffer"
00239 // </etymology>
00240 //
00241 // <synopsis>
00242 // The DJonesMBuf class holds a buffer, optionally connected to a 
00243 // DJones calibration main table iterator (of base type CalIterBase). 
00244 // The DJones matrix contains instrumental polarization corrections.
00245 // </synopsis>
00246 //
00247 // <example>
00248 // <srcblock>
00249 // </srcblock>
00250 // </example>
00251 //
00252 // <motivation>
00253 // Encapsulate DJones calibration main table data buffers.
00254 // </motivation>
00255 //
00256 // <todo asof="01/08/01">
00257 // (i) Deal with non-standard columns.
00258 // </todo>
00259 
00260 class DJonesMBuf : public SolvableVisJonesMBuf
00261 {
00262  public:
00263   // Default constructor. No connection to an underlying
00264   // calibration table iterator in this case.
00265   DJonesMBuf();
00266 
00267   // Construct from a set of calibration buffer indices and
00268   // their specified values. Non-index columns will be set 
00269   // to default values, and there is no connection to an 
00270   // underlying calibration table iterator in this case.
00271   DJonesMBuf (const Vector<Int>& calIndices, 
00272               const Block<Vector<Int> >& indexValues);
00273 
00274   // Construct from a calibration table iterator. The calibration
00275   // buffer will remain synchronized with the iterator.
00276   DJonesMBuf (CalIterBase& calIter);
00277 
00278  protected:
00279 
00280  private:
00281 };
00282 
00283 // <summary> 
00284 // TJonesMBuf: TJones calibration main table buffer
00285 // </summary>
00286 
00287 // <use visibility=export>
00288 
00289 // <reviewed reviewer="" date="" tests="" demos="">
00290 
00291 // <prerequisite>
00292 // <li> <linkto class="CalMainBuffer">CalMainBuffer</linkto> module
00293 // <li> <linkto class="SolvableVisJonesMBuf">SolvableVisJonesMBuf</linkto> module
00294 // </prerequisite>
00295 //
00296 // <etymology>
00297 // From "TJones matrix", "cal main table" and "buffer"
00298 // </etymology>
00299 //
00300 // <synopsis>
00301 // The TJonesMBuf class holds a buffer, optionally connected to a 
00302 // TJones calibration main table iterator (of base type CalIterBase). 
00303 // The TJones matrix contains atmospheric corrections.
00304 // </synopsis>
00305 //
00306 // <example>
00307 // <srcblock>
00308 // </srcblock>
00309 // </example>
00310 //
00311 // <motivation>
00312 // Encapsulate TJones calibration main table data buffers.
00313 // </motivation>
00314 //
00315 // <todo asof="01/08/01">
00316 // (i) Deal with non-standard columns.
00317 // </todo>
00318 
00319 class TJonesMBuf : public SolvableVisJonesMBuf
00320 {
00321  public:
00322   // Default constructor. No connection to an underlying
00323   // calibration table iterator in this case.
00324   TJonesMBuf();
00325 
00326   // Construct from a set of calibration buffer indices and
00327   // their specified values. Non-index columns will be set 
00328   // to default values, and there is no connection to an 
00329   // underlying calibration table iterator in this case.
00330   TJonesMBuf (const Vector<Int>& calIndices, 
00331               const Block<Vector<Int> >& indexValues);
00332 
00333   // Construct from a calibration table iterator. The calibration
00334   // buffer will remain synchronized with the iterator.
00335   TJonesMBuf (CalIterBase& calIter);
00336 
00337  protected:
00338 
00339  private:
00340 };
00341 
00342 
00343 } //# NAMESPACE CASA - END
00344 
00345 #endif
00346    
00347   
00348 
00349 
00350