casa
$Rev:20696$
|
00001 //# BJonesMBuf.h: BJones 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_BJONESMBUF_H 00030 #define CALIBRATION_BJONESMBUF_H 00031 00032 #include <measures/Measures/MFrequency.h> 00033 #include <synthesis/CalTables/SolvableVJMBuf.h> 00034 #include <synthesis/CalTables/BJonesMCol.h> 00035 #include <synthesis/CalTables/BJonesTable.h> 00036 00037 namespace casa { //# NAMESPACE CASA - BEGIN 00038 00039 // <summary> 00040 // BJonesMBuf: BJones 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 // </prerequisite> 00051 // 00052 // <etymology> 00053 // From "BJones matrix", "cal main table" and "buffer" 00054 // </etymology> 00055 // 00056 // <synopsis> 00057 // The BJonesMBuf class holds a buffer, optionally connected to a 00058 // BJones calibration main table iterator (of base type CalIterBase). 00059 // The BJones matrix contains bandpass correction terms. 00060 // </synopsis> 00061 // 00062 // <example> 00063 // <srcblock> 00064 // </srcblock> 00065 // </example> 00066 // 00067 // <motivation> 00068 // Encapsulate BJones 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 BJonesMBuf : public SolvableVisJonesMBuf 00076 { 00077 public: 00078 // Default constructor. No connection to an underlying 00079 // calibration table iterator in this case. 00080 BJonesMBuf(); 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 BJonesMBuf (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 BJonesMBuf (CalIterBase& calIter); 00092 00093 protected: 00094 00095 private: 00096 }; 00097 00098 // <summary> 00099 // BJonesPolyMBuf: BJonesPoly calibration main table buffer 00100 // </summary> 00101 00102 // <use visibility=export> 00103 00104 // <reviewed reviewer="" date="" tests="" demos=""> 00105 00106 // <prerequisite> 00107 //<li><linkto class="CalMainBuffer">CalMainBuffer</linkto> module 00108 //<li><linkto class="SolvableVisJonesMBuf">SolvableVisJonesMBuf</linkto> module 00109 // </prerequisite> 00110 // 00111 // <etymology> 00112 // From "BJonesPoly matrix", "cal main table" and "buffer" 00113 // </etymology> 00114 // 00115 // <synopsis> 00116 // The BJonesPolyMBuf class holds a buffer, optionally connected to a 00117 // BJonesPoly calibration main table iterator (of base type CalIterBase). 00118 // The BJonesPoly matrix contains bandpass correction terms. 00119 // </synopsis> 00120 // 00121 // <example> 00122 // <srcblock> 00123 // </srcblock> 00124 // </example> 00125 // 00126 // <motivation> 00127 // Encapsulate BJonesPoly calibration main table data buffers. 00128 // </motivation> 00129 // 00130 // <todo asof="01/08/01"> 00131 // (i) Deal with non-standard columns. 00132 // </todo> 00133 00134 class BJonesPolyMBuf : public BJonesMBuf 00135 { 00136 public: 00137 // Default constructor. No connection to an underlying 00138 // calibration table iterator in this case. 00139 BJonesPolyMBuf(); 00140 00141 // Construct from a set of calibration buffer indices and 00142 // their specified values. Non-index columns will be set 00143 // to default values, and there is no connection to an 00144 // underlying calibration table iterator in this case. 00145 BJonesPolyMBuf (const Vector<Int>& calIndices, 00146 const Block<Vector<Int> >& indexValues); 00147 00148 // Construct from a calibration table iterator. The calibration 00149 // buffer will remain synchronized with the iterator. 00150 BJonesPolyMBuf (CalIterBase& calIter); 00151 00152 // Write the current buffer at the end of a specified cal table 00153 virtual Int append (CalTable& calTable); 00154 00155 // Maximum number of rows in the calibration buffer 00156 virtual Int nRow(); 00157 00158 // Update the parametrized solution for a given antenna id. 00159 virtual Bool putAntGain (const Int& antennaId, const String& sFreqGrpName, 00160 const String& sPolyType, 00161 const Complex& sScaleFactor, 00162 const Vector<Double>& sValidDomain, 00163 const Int& sNPolyAmp, const Int& sNPolyPhase, 00164 const Vector<Double>& sPolyCoeffAmp, 00165 const Vector<Double>& sPolyCoeffPhase, 00166 const String& sPhaseUnits, 00167 const Complex& sSideBandRef, 00168 const MFrequency& sRefFreq, const Int& sRefAnt); 00169 00170 // Data field accessors 00171 Vector<String>& polyType(); 00172 Vector<String>& polyMode(); 00173 Vector<Complex>& scaleFactor(); 00174 Array<Double>& validDomain(); 00175 Vector<Int>& nPolyAmp(); 00176 Vector<Int>& nPolyPhase(); 00177 Array<Double>& polyCoeffAmp(); 00178 Array<Double>& polyCoeffPhase(); 00179 Vector<String>& phaseUnits(); 00180 Vector<Complex>& sideBandRef(); 00181 00182 protected: 00183 // Factory method to create a columns accessor object of the 00184 // appropriate type 00185 virtual BJonesPolyMCol* newCalMainCol (CalTable& calTable) { 00186 return new BJonesPolyMCol(dynamic_cast<BJonesPolyTable&>(calTable));}; 00187 00188 // Access to the columns accessor object 00189 virtual BJonesPolyMCol* calMainCol() 00190 {return dynamic_cast<BJonesPolyMCol*>(CalMainBuffer::calMainCol());}; 00191 00192 // Invalidate the current cache. 00193 virtual void invalidate(); 00194 00195 // <group> 00196 // Fill the BJonesPoly cal buffer attribute columns in an empty 00197 // cal buffer, to extend the inherited method fillAttributes. The 00198 // cal indices, specified as enums from class MSCalEnums, are excluded 00199 // as non-attribute columns. 00200 // 00201 // Use a visibility buffer to define the attribute values (NYI) 00202 virtual void fillAttributes(const Vector<Int>& /*calIndices*/, 00203 const VisBuffer& /*vb*/) {}; 00204 // 00205 // Set default attribute values 00206 virtual void fillAttributes(const Vector<Int>& calIndices); 00207 // </group> 00208 00209 private: 00210 // Buffer fields 00211 Vector<String> polyType_p; 00212 Vector<String> polyMode_p; 00213 Vector<Complex> scaleFactor_p; 00214 Array<Double> validDomain_p; 00215 Vector<Int> nPolyAmp_p; 00216 Vector<Int> nPolyPhase_p; 00217 Array<Double> polyCoeffAmp_p; 00218 Array<Double> polyCoeffPhase_p; 00219 Vector<String> phaseUnits_p; 00220 Vector<Complex> sideBandRef_p; 00221 00222 // Buffer field status flags 00223 Bool polyTypeOK_p; 00224 Bool polyModeOK_p; 00225 Bool scaleFactorOK_p; 00226 Bool validDomainOK_p; 00227 Bool nPolyAmpOK_p; 00228 Bool nPolyPhaseOK_p; 00229 Bool polyCoeffAmpOK_p; 00230 Bool polyCoeffPhaseOK_p; 00231 Bool phaseUnitsOK_p; 00232 Bool sideBandRefOK_p; 00233 }; 00234 00235 00236 } //# NAMESPACE CASA - END 00237 00238 #endif 00239 00240 00241 00242 00243