casa
$Rev:20696$
|
00001 //# GJonesMBuf.h: GJones 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_GJONESMBUF_H 00030 #define CALIBRATION_GJONESMBUF_H 00031 00032 #include <measures/Measures/MFrequency.h> 00033 #include <synthesis/CalTables/SolvableVJMBuf.h> 00034 #include <synthesis/CalTables/GJonesMCol.h> 00035 #include <synthesis/CalTables/GJonesTable.h> 00036 00037 namespace casa { //# NAMESPACE CASA - BEGIN 00038 00039 // <summary> 00040 // GJonesPolyMBuf: GJonesPoly calibration main table buffer 00041 // </summary> 00042 00043 // <use visibility=export> 00044 00045 // <reviewed reviewer="" date="" tests="" demos=""> 00046 00047 // <prerequisite> 00048 //<li><linkto class="CalMainBuffer">CalMainBuffer</linkto> module 00049 //<li><linkto class="SolvableVisJonesMBuf">SolvableVisJonesMBuf</linkto> module 00050 //<li><linkto class="GJonesMBuf">GJonesMBuf</linkto> module 00051 // </prerequisite> 00052 // 00053 // <etymology> 00054 // From "GJonesPoly matrix", "cal main table" and "buffer" 00055 // </etymology> 00056 // 00057 // <synopsis> 00058 // The GJonesPolyMBuf class holds a buffer, optionally connected to a 00059 // GJonesPoly calibration main table iterator (of base type CalIterBase). 00060 // The GJonesPoly matrix contains electronic gains expressed as 00061 // polynomials over time. 00062 // </synopsis> 00063 // 00064 // <example> 00065 // <srcblock> 00066 // </srcblock> 00067 // </example> 00068 // 00069 // <motivation> 00070 // Encapsulate GJonesPoly calibration main table data buffers. 00071 // </motivation> 00072 // 00073 // <todo asof="01/08/01"> 00074 // (i) Deal with non-standard columns. 00075 // </todo> 00076 00077 class GJonesPolyMBuf : public GJonesMBuf 00078 { 00079 public: 00080 // Default constructor. No connection to an underlying 00081 // calibration table iterator in this case. 00082 GJonesPolyMBuf(); 00083 00084 // Construct from a set of calibration buffer indices and 00085 // their specified values. Non-index columns will be set 00086 // to default values, and there is no connection to an 00087 // underlying calibration table iterator in this case. 00088 GJonesPolyMBuf (const Vector<Int>& calIndices, 00089 const Block<Vector<Int> >& indexValues); 00090 00091 // Construct from a calibration table iterator. The calibration 00092 // buffer will remain synchronized with the iterator. 00093 GJonesPolyMBuf (CalIterBase& calIter); 00094 00095 // Invalidate the current calibration buffer. This signals 00096 // that a re-read is required as the iterator has advanced 00097 virtual void invalidate(); 00098 00099 // Write the current buffer at the end of a specified cal table 00100 virtual Int append (CalTable& calTable); 00101 00102 // Maximum number of rows in the calibration buffer 00103 virtual Int nRow(); 00104 00105 // Update the parametrized solution in each of a set of buffer rows 00106 virtual Bool fillMatchingRows (const Vector<Int>& matchingRows, 00107 const String& sFreqGrpName, 00108 const String& sPolyType, 00109 const String& sPolyMode, 00110 const Complex& sScaleFactor, 00111 const Int& sNPolyAmp, const Int& sNPolyPhase, 00112 const Vector<Double>& sPolyCoeffAmp, 00113 const Vector<Double>& sPolyCoeffPhase, 00114 const String& sPhaseUnits, 00115 const MFrequency& sRefFreq, 00116 const Int& sRefAnt); 00117 00118 // Data field accessors 00119 virtual Vector<String>& polyType(); 00120 virtual Vector<String>& polyMode(); 00121 virtual Vector<Complex>& scaleFactor(); 00122 virtual Vector<Int>& nPolyAmp(); 00123 virtual Vector<Int>& nPolyPhase(); 00124 virtual Array<Double>& polyCoeffAmp(); 00125 virtual Array<Double>& polyCoeffPhase(); 00126 virtual Vector<String>& phaseUnits(); 00127 00128 protected: 00129 // Factory method to create a columns accessor object of the 00130 // appropriate type 00131 virtual GJonesPolyMCol* newCalMainCol (CalTable& calTable) { 00132 return new GJonesPolyMCol(dynamic_cast<GJonesPolyTable&>(calTable));}; 00133 00134 // Access to the columns accessor object 00135 virtual GJonesPolyMCol* calMainCol() 00136 {return dynamic_cast<GJonesPolyMCol*>(CalMainBuffer::calMainCol());}; 00137 00138 // <group> 00139 // Fill the GJonesPoly cal buffer attribute columns in an empty 00140 // cal buffer, to extend the inherited method fillAttributes. The 00141 // cal indices, specified as enums from class MSCalEnums, are excluded 00142 // as non-attribute columns. 00143 // 00144 // Use a visibility buffer to define the attribute values (NYI) 00145 virtual void fillAttributes(const Vector<Int>& /*calIndices*/, 00146 const VisBuffer& /*vb*/) {}; 00147 // 00148 // Set default attribute values 00149 virtual void fillAttributes(const Vector<Int>& calIndices); 00150 // </group> 00151 00152 private: 00153 // Buffer fields 00154 Vector<String> polyType_p; 00155 Vector<String> polyMode_p; 00156 Vector<Complex> scaleFactor_p; 00157 Vector<Int> nPolyAmp_p; 00158 Vector<Int> nPolyPhase_p; 00159 Array<Double> polyCoeffAmp_p; 00160 Array<Double> polyCoeffPhase_p; 00161 Vector<String> phaseUnits_p; 00162 00163 // Buffer field status flags 00164 Bool polyTypeOK_p; 00165 Bool polyModeOK_p; 00166 Bool scaleFactorOK_p; 00167 Bool nPolyAmpOK_p; 00168 Bool nPolyPhaseOK_p; 00169 Bool polyCoeffAmpOK_p; 00170 Bool polyCoeffPhaseOK_p; 00171 Bool phaseUnitsOK_p; 00172 }; 00173 00174 // <summary> 00175 // GJonesSplineMBuf: GJonesSpline calibration main table buffer 00176 // </summary> 00177 00178 // <use visibility=export> 00179 00180 // <reviewed reviewer="" date="" tests="" demos=""> 00181 00182 // <prerequisite> 00183 //<li><linkto class="CalMainBuffer">CalMainBuffer</linkto> module 00184 //<li><linkto class="SolvableVisJonesMBuf">SolvableVisJonesMBuf</linkto> module 00185 //<li><linkto class="GJonesMBuf">GJonesMBuf</linkto> module 00186 //<li><linkto class="GJonesPolyMBuf">GJonesPolyMBuf</linkto> module 00187 // </prerequisite> 00188 // 00189 // <etymology> 00190 // From "GJonesSpline matrix", "cal main table" and "buffer" 00191 // </etymology> 00192 // 00193 // <synopsis> 00194 // The GJonesSplineMBuf class holds a buffer, optionally connected to a 00195 // GJonesSpline calibration main table iterator (of base type CalIterBase). 00196 // The GJonesSpline matrix contains electronic gain terms expressed as 00197 // as spline polynomials over time. 00198 // </synopsis> 00199 // 00200 // <example> 00201 // <srcblock> 00202 // </srcblock> 00203 // </example> 00204 // 00205 // <motivation> 00206 // Encapsulate GJonesSpline calibration main table data buffers. 00207 // </motivation> 00208 // 00209 // <todo asof="01/08/01"> 00210 // (i) Deal with non-standard columns. 00211 // </todo> 00212 00213 class GJonesSplineMBuf : public GJonesPolyMBuf 00214 { 00215 public: 00216 // Default constructor. No connection to an underlying 00217 // calibration table iterator in this case. 00218 GJonesSplineMBuf(); 00219 00220 // Construct from a set of calibration buffer indices and 00221 // their specified values. Non-index columns will be set 00222 // to default values, and there is no connection to an 00223 // underlying calibration table iterator in this case. 00224 GJonesSplineMBuf (const Vector<Int>& calIndices, 00225 const Block<Vector<Int> >& indexValues); 00226 00227 // Construct from a calibration table iterator. The calibration 00228 // buffer will remain synchronized with the iterator. 00229 GJonesSplineMBuf (CalIterBase& calIter); 00230 00231 // Invalidate the current calibration buffer. This signals 00232 // that a re-read is required as the iterator has advanced 00233 virtual void invalidate(); 00234 00235 // Write the current buffer at the end of a specified cal table 00236 virtual Int append (CalTable& calTable); 00237 00238 // Maximum number of rows in the calibration buffer 00239 virtual Int nRow(); 00240 00241 // Update the parametrized solution in each of a set of buffer rows 00242 virtual Bool fillMatchingRows (const Vector<Int>& matchingRows, 00243 const String& sFreqGrpName, 00244 const String& sPolyType, 00245 const String& sPolyMode, 00246 const Complex& sScaleFactor, 00247 const Int& sNPolyAmp, const Int& sNPolyPhase, 00248 const Vector<Double>& sPolyCoeffAmp, 00249 const Vector<Double>& sPolyCoeffPhase, 00250 const String& sPhaseUnits, 00251 const Int& sNKnotsAmp, 00252 const Int& sNKnotsPhase, 00253 const Vector<Double>& sSplineKnotsAmp, 00254 const Vector<Double>& sSplineKnotsPhase, 00255 const MFrequency& sRefFreq, 00256 const Int& sRefAnt); 00257 00258 // Data field accessors 00259 virtual Vector<Int>& nKnotsAmp(); 00260 virtual Vector<Int>& nKnotsPhase(); 00261 virtual Array<Double>& splineKnotsAmp(); 00262 virtual Array<Double>& splineKnotsPhase(); 00263 00264 protected: 00265 // Factory method to create a columns accessor object of the 00266 // appropriate type 00267 virtual GJonesSplineMCol* newCalMainCol (CalTable& calTable) { 00268 return new GJonesSplineMCol(dynamic_cast<GJonesSplineTable&>(calTable));}; 00269 00270 // Access to the columns accessor object 00271 virtual GJonesSplineMCol* calMainCol() 00272 {return dynamic_cast<GJonesSplineMCol*>(CalMainBuffer::calMainCol());}; 00273 00274 // <group> 00275 // Fill the GJonesSpline cal buffer attribute columns in an empty 00276 // cal buffer, to extend the inherited method fillAttributes. The 00277 // cal indices, specified as enums from class MSCalEnums, are excluded 00278 // as non-attribute columns. 00279 // 00280 // Use a visibility buffer to define the attribute values (NYI) 00281 virtual void fillAttributes(const Vector<Int>& /*calIndices*/, 00282 const VisBuffer& /*vb*/) {}; 00283 // 00284 // Set default attribute values 00285 virtual void fillAttributes(const Vector<Int>& calIndices); 00286 // </group> 00287 00288 private: 00289 // Buffer fields 00290 Vector<Int> nKnotsAmp_p; 00291 Vector<Int> nKnotsPhase_p; 00292 Array<Double> splineKnotsAmp_p; 00293 Array<Double> splineKnotsPhase_p; 00294 00295 // Buffer field status flags 00296 Bool nKnotsAmpOK_p; 00297 Bool nKnotsPhaseOK_p; 00298 Bool splineKnotsAmpOK_p; 00299 Bool splineKnotsPhaseOK_p; 00300 }; 00301 00302 00303 } //# NAMESPACE CASA - END 00304 00305 #endif 00306 00307 00308 00309 00310