Line data Source code
1 : //# BJonesMBuf.h: BJones calibration main table buffer 2 : //# Copyright (C) 1996,1997,1998,2001,2002,2003 3 : //# Associated Universities, Inc. Washington DC, USA. 4 : //# 5 : //# This library is free software; you can redistribute it and/or modify it 6 : //# under the terms of the GNU Library General Public License as published by 7 : //# the Free Software Foundation; either version 2 of the License, or (at your 8 : //# option) any later version. 9 : //# 10 : //# This library is distributed in the hope that it will be useful, but WITHOUT 11 : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 : //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 13 : //# License for more details. 14 : //# 15 : //# You should have received a copy of the GNU Library General Public License 16 : //# along with this library; if not, write to the Free Software Foundation, 17 : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 18 : //# 19 : //# Correspondence concerning AIPS++ should be adressed as follows: 20 : //# Internet email: casa-feedback@nrao.edu. 21 : //# Postal address: AIPS++ Project Office 22 : //# National Radio Astronomy Observatory 23 : //# 520 Edgemont Road 24 : //# Charlottesville, VA 22903-2475 USA 25 : //# 26 : //# 27 : //# $Id$ 28 : 29 : #ifndef CALIBRATION_BJONESMBUF_H 30 : #define CALIBRATION_BJONESMBUF_H 31 : 32 : #include <casacore/measures/Measures/MFrequency.h> 33 : #include <synthesis/CalTables/SolvableVJMBuf.h> 34 : #include <synthesis/CalTables/BJonesMCol.h> 35 : #include <synthesis/CalTables/BJonesTable.h> 36 : 37 : namespace casa { //# NAMESPACE CASA - BEGIN 38 : 39 : // <summary> 40 : // BJonesMBuf: BJones calibration main table buffer 41 : // </summary> 42 : 43 : // <use visibility=export> 44 : 45 : // <reviewed reviewer="" date="" tests="" demos=""> 46 : 47 : // <prerequisite> 48 : //<li><linkto class="CalMainBuffer">CalMainBuffer</linkto> module 49 : //<li><linkto class="SolvableVisJonesMBuf">SolvableVisJonesMBuf</linkto> module 50 : // </prerequisite> 51 : // 52 : // <etymology> 53 : // From "BJones matrix", "cal main table" and "buffer" 54 : // </etymology> 55 : // 56 : // <synopsis> 57 : // The BJonesMBuf class holds a buffer, optionally connected to a 58 : // BJones calibration main table iterator (of base type CalIterBase). 59 : // The BJones matrix contains bandpass correction terms. 60 : // </synopsis> 61 : // 62 : // <example> 63 : // <srcblock> 64 : // </srcblock> 65 : // </example> 66 : // 67 : // <motivation> 68 : // Encapsulate BJones calibration main table data buffers. 69 : // </motivation> 70 : // 71 : // <todo asof="01/08/01"> 72 : // (i) Deal with non-standard columns. 73 : // </todo> 74 : 75 : class BJonesMBuf : public SolvableVisJonesMBuf 76 : { 77 : public: 78 : // Default constructor. No connection to an underlying 79 : // calibration table iterator in this case. 80 : BJonesMBuf(); 81 : 82 : // Construct from a set of calibration buffer indices and 83 : // their specified values. Non-index columns will be set 84 : // to default values, and there is no connection to an 85 : // underlying calibration table iterator in this case. 86 : BJonesMBuf (const casacore::Vector<casacore::Int>& calIndices, 87 : const casacore::Block<casacore::Vector<casacore::Int> >& indexValues); 88 : 89 : // Construct from a calibration table iterator. The calibration 90 : // buffer will remain synchronized with the iterator. 91 : BJonesMBuf (CalIterBase& calIter); 92 : 93 : protected: 94 : 95 : private: 96 : }; 97 : 98 : // <summary> 99 : // BJonesPolyMBuf: BJonesPoly calibration main table buffer 100 : // </summary> 101 : 102 : // <use visibility=export> 103 : 104 : // <reviewed reviewer="" date="" tests="" demos=""> 105 : 106 : // <prerequisite> 107 : //<li><linkto class="CalMainBuffer">CalMainBuffer</linkto> module 108 : //<li><linkto class="SolvableVisJonesMBuf">SolvableVisJonesMBuf</linkto> module 109 : // </prerequisite> 110 : // 111 : // <etymology> 112 : // From "BJonesPoly matrix", "cal main table" and "buffer" 113 : // </etymology> 114 : // 115 : // <synopsis> 116 : // The BJonesPolyMBuf class holds a buffer, optionally connected to a 117 : // BJonesPoly calibration main table iterator (of base type CalIterBase). 118 : // The BJonesPoly matrix contains bandpass correction terms. 119 : // </synopsis> 120 : // 121 : // <example> 122 : // <srcblock> 123 : // </srcblock> 124 : // </example> 125 : // 126 : // <motivation> 127 : // Encapsulate BJonesPoly calibration main table data buffers. 128 : // </motivation> 129 : // 130 : // <todo asof="01/08/01"> 131 : // (i) Deal with non-standard columns. 132 : // </todo> 133 : 134 : class BJonesPolyMBuf : public BJonesMBuf 135 : { 136 : public: 137 : // Default constructor. No connection to an underlying 138 : // calibration table iterator in this case. 139 : BJonesPolyMBuf(); 140 : 141 : // Construct from a set of calibration buffer indices and 142 : // their specified values. Non-index columns will be set 143 : // to default values, and there is no connection to an 144 : // underlying calibration table iterator in this case. 145 : BJonesPolyMBuf (const casacore::Vector<casacore::Int>& calIndices, 146 : const casacore::Block<casacore::Vector<casacore::Int> >& indexValues); 147 : 148 : // Construct from a calibration table iterator. The calibration 149 : // buffer will remain synchronized with the iterator. 150 : BJonesPolyMBuf (CalIterBase& calIter); 151 : 152 : // Write the current buffer at the end of a specified cal table 153 : virtual casacore::Int append (CalTable& calTable); 154 : 155 : // Maximum number of rows in the calibration buffer 156 : virtual casacore::Int nRow(); 157 : 158 : // Update the parametrized solution for a given antenna id. 159 : virtual casacore::Bool putAntGain (const casacore::Int& antennaId, const casacore::String& sFreqGrpName, 160 : const casacore::String& sPolyType, 161 : const casacore::Complex& sScaleFactor, 162 : const casacore::Vector<casacore::Double>& sValidDomain, 163 : const casacore::Int& sNPolyAmp, const casacore::Int& sNPolyPhase, 164 : const casacore::Vector<casacore::Double>& sPolyCoeffAmp, 165 : const casacore::Vector<casacore::Double>& sPolyCoeffPhase, 166 : const casacore::String& sPhaseUnits, 167 : const casacore::Complex& sSideBandRef, 168 : const casacore::MFrequency& sRefFreq, const casacore::Int& sRefAnt); 169 : 170 : // casacore::Data field accessors 171 : casacore::Vector<casacore::String>& polyType(); 172 : casacore::Vector<casacore::String>& polyMode(); 173 : casacore::Vector<casacore::Complex>& scaleFactor(); 174 : casacore::Array<casacore::Double>& validDomain(); 175 : casacore::Vector<casacore::Int>& nPolyAmp(); 176 : casacore::Vector<casacore::Int>& nPolyPhase(); 177 : casacore::Array<casacore::Double>& polyCoeffAmp(); 178 : casacore::Array<casacore::Double>& polyCoeffPhase(); 179 : casacore::Vector<casacore::String>& phaseUnits(); 180 : casacore::Vector<casacore::Complex>& sideBandRef(); 181 : 182 : protected: 183 : // Factory method to create a columns accessor object of the 184 : // appropriate type 185 0 : virtual BJonesPolyMCol* newCalMainCol (CalTable& calTable) { 186 0 : return new BJonesPolyMCol(dynamic_cast<BJonesPolyTable&>(calTable));}; 187 : 188 : // Access to the columns accessor object 189 0 : virtual BJonesPolyMCol* calMainCol() 190 0 : {return dynamic_cast<BJonesPolyMCol*>(CalMainBuffer::calMainCol());}; 191 : 192 : // Invalidate the current cache. 193 : virtual void invalidate(); 194 : 195 : // <group> 196 : // Fill the BJonesPoly cal buffer attribute columns in an empty 197 : // cal buffer, to extend the inherited method fillAttributes. The 198 : // cal indices, specified as enums from class MSCalEnums, are excluded 199 : // as non-attribute columns. 200 : // 201 : // Use a visibility buffer to define the attribute values (NYI) 202 0 : virtual void fillAttributes(const casacore::Vector<casacore::Int>& /*calIndices*/, 203 0 : const VisBuffer& /*vb*/) {}; 204 : // 205 : // Set default attribute values 206 : virtual void fillAttributes(const casacore::Vector<casacore::Int>& calIndices); 207 : // </group> 208 : 209 : private: 210 : // Buffer fields 211 : casacore::Vector<casacore::String> polyType_p; 212 : casacore::Vector<casacore::String> polyMode_p; 213 : casacore::Vector<casacore::Complex> scaleFactor_p; 214 : casacore::Array<casacore::Double> validDomain_p; 215 : casacore::Vector<casacore::Int> nPolyAmp_p; 216 : casacore::Vector<casacore::Int> nPolyPhase_p; 217 : casacore::Array<casacore::Double> polyCoeffAmp_p; 218 : casacore::Array<casacore::Double> polyCoeffPhase_p; 219 : casacore::Vector<casacore::String> phaseUnits_p; 220 : casacore::Vector<casacore::Complex> sideBandRef_p; 221 : 222 : // Buffer field status flags 223 : casacore::Bool polyTypeOK_p; 224 : casacore::Bool polyModeOK_p; 225 : casacore::Bool scaleFactorOK_p; 226 : casacore::Bool validDomainOK_p; 227 : casacore::Bool nPolyAmpOK_p; 228 : casacore::Bool nPolyPhaseOK_p; 229 : casacore::Bool polyCoeffAmpOK_p; 230 : casacore::Bool polyCoeffPhaseOK_p; 231 : casacore::Bool phaseUnitsOK_p; 232 : casacore::Bool sideBandRefOK_p; 233 : }; 234 : 235 : 236 : } //# NAMESPACE CASA - END 237 : 238 : #endif 239 : 240 : 241 : 242 : 243 :