casa
$Rev:20696$
|
00001 //# CalVisBuffer.h: A VisBuffer with extra stuff for calibration 00002 //# Copyright (C) 2008 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 addressed 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 //# $Id: VisBuffer.h,v 19.14 2006/02/28 04:48:58 mvoronko Exp $ 00027 00028 #ifndef MSVIS_CALVISBUFFER_H 00029 #define MSVIS_CALVISBUFFER_H 00030 00031 #include <casa/aips.h> 00032 #include <synthesis/MSVis/VisBuffer.h> 00033 00034 namespace casa { //# NAMESPACE CASA - BEGIN 00035 00036 //#forward 00037 00038 //<summary>CalVisBuffer extends VisBuffer to support storage and recall of associated residual and differentiated residual data. </summary> 00039 // 00040 // <use visibility=export> 00041 // 00042 // <reviewed reviewer="" date="" tests="" demos=""> 00043 00044 // <prerequisite> 00045 // <li> <linkto class="VisBuffer">VisBuffer</linkto> 00046 // </prerequisite> 00047 // 00048 // <etymology> 00049 // CalVisBuffer is a VisBuffer for calibration solving 00050 // </etymology> 00051 // 00052 //<synopsis> 00053 // This class extends <linkto class="VisBuffer">VisBuffer to support 00054 // storage and recall of calibration solving-related information 00055 // such as residuals (difference of trial-corrupted model data and 00056 // observed data) and corresponding differentiated residuals. 00057 // 00058 // (say something about synchronization with VisIter, etc.) 00059 // 00060 //</synopsis> 00061 00062 //<todo> 00063 // <li> write todo list 00064 //</todo> 00065 class CalVisBuffer : public VisBuffer 00066 { 00067 public: 00068 // Create empty VisBuffer you can assign to or attach. 00069 CalVisBuffer(); 00070 // Construct VisBuffer for a particular VisibilityIterator 00071 // The buffer will remain synchronized with the iterator. 00072 CalVisBuffer(ROVisibilityIterator & iter); 00073 00074 // Copy construct, looses synchronization with iterator: only use buffer for 00075 // current iteration (or reattach). 00076 CalVisBuffer(const CalVisBuffer& cvb); 00077 00078 // Destructor (detaches from VisIter) 00079 ~CalVisBuffer(); 00080 00081 // Assignment, looses synchronization with iterator: only use buffer for 00082 // current iteration (or reattach) 00083 CalVisBuffer& operator=(const VisBuffer& cvb); 00084 00085 // Assignment, optionally without copying the data across; with copy=True 00086 // this is identical to normal assignment operator 00087 CalVisBuffer& assign(const VisBuffer& vb, Bool copy=True); 00088 00089 // Update (simple) coord info 00090 // (this OVERRIDES VisBuffer::updateCoordInfo(), which does more) 00091 void updateCoordInfo(); 00092 00093 // Apply amp-only or phase-only to data 00094 void enforceAPonData(const String& apmode); 00095 00096 // Set the focus channel 00097 // (forms references to focus-channel flag/data/model) 00098 void setFocusChan(const Int focusChan=-1); 00099 00100 // Size/init/finalize the residuals workspaces 00101 void sizeResiduals(const Int& nPar,const Int& nDiff); 00102 void initResidWithModel(); 00103 void finalizeResiduals(); 00104 00105 // Delete the workspaces 00106 void cleanUp(); 00107 00108 // <group> 00109 // Access functions 00110 // 00111 00112 // Access to focus-channel slices of the flags, data, and model 00113 // Cube<Bool>& infocusFlagCube() { return infocusFlagCube_p; } 00114 // const Cube<Bool>& infocusFlagCube() const {return this->infocusFlagCube();} 00115 00116 Matrix<Bool>& infocusFlag() { return infocusFlag_p; } 00117 const Matrix<Bool>& infocusFlag() const {return this->infocusFlag();} 00118 00119 Cube<Complex>& infocusVisCube() { return infocusVisCube_p; } 00120 const Cube<Complex>& infocusVisCube() const {return this->infocusVisCube();} 00121 00122 Cube<Complex>& infocusModelVisCube() { return infocusModelVisCube_p; } 00123 const Cube<Complex>& infocusModelVisCube() const {return this->infocusModelVisCube();} 00124 00125 // Workspace for the residual visibilities 00126 Cube<Complex>& residuals() { return residuals_p; } 00127 const Cube<Complex>& residuals() const {return this->residuals();} 00128 00129 // Workspace for flags of the residuals 00130 Matrix<Bool>& residFlag() { return residFlag_p; } 00131 const Matrix<Bool>& residFlag() const {return this->residFlag();} 00132 00133 // Workspace for the differentiated residuals 00134 Array<Complex>& diffResiduals() { return diffResiduals_p; } 00135 const Array<Complex>& diffResiduals() const {return this->diffResiduals();} 00136 00137 //</group> 00138 00139 private: 00140 00141 // The current in-focus channel 00142 Int focusChan_p; 00143 00144 // actual storage for the data 00145 // Cube<Bool> infocusFlagCube_p; 00146 Matrix<Bool> infocusFlag_p; 00147 Cube<Complex> infocusVisCube_p; 00148 Cube<Complex> infocusModelVisCube_p; 00149 00150 Cube<Complex> residuals_p; 00151 Matrix<Bool> residFlag_p; 00152 Array<Complex> diffResiduals_p; 00153 }; 00154 00155 00156 } //# NAMESPACE CASA - END 00157 00158 #endif 00159