casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalVisBuffer.h
Go to the documentation of this file.
1 //# CalVisBuffer.h: A VisBuffer with extra stuff for calibration
2 //# Copyright (C) 2008
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 addressed as follows:
20 //# Internet email: aips2-request@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 //# $Id: VisBuffer.h,v 19.14 2006/02/28 04:48:58 mvoronko Exp $
27 
28 #ifndef MSVIS_CALVISBUFFER_H
29 #define MSVIS_CALVISBUFFER_H
30 
31 #include <casa/aips.h>
32 #include <msvis/MSVis/VisBuffer.h>
33 
34 namespace casa { //# NAMESPACE CASA - BEGIN
35 
36 //#forward
37 
38 //<summary>CalVisBuffer extends VisBuffer to support storage and recall of associated residual and differentiated residual data. </summary>
39 //
40 // <use visibility=export>
41 //
42 // <reviewed reviewer="" date="" tests="" demos="">
43 
44 // <prerequisite>
45 // <li> <linkto class="VisBuffer">VisBuffer</linkto>
46 // </prerequisite>
47 //
48 // <etymology>
49 // CalVisBuffer is a VisBuffer for calibration solving
50 // </etymology>
51 //
52 //<synopsis>
53 // This class extends <linkto class="VisBuffer">VisBuffer to support
54 // storage and recall of calibration solving-related information
55 // such as residuals (difference of trial-corrupted model data and
56 // observed data) and corresponding differentiated residuals.
57 //
58 // (say something about synchronization with VisIter, etc.)
59 //
60 //</synopsis>
61 
62 //<todo>
63 // <li> write todo list
64 //</todo>
65 class CalVisBuffer : public VisBuffer
66 {
67 public:
68  // Create empty VisBuffer you can assign to or attach.
69  CalVisBuffer();
70  // Construct VisBuffer for a particular VisibilityIterator
71  // The buffer will remain synchronized with the iterator.
73 
74  // Copy construct, looses synchronization with iterator: only use buffer for
75  // current iteration (or reattach).
76  CalVisBuffer(const CalVisBuffer& cvb);
77 
78  // Destructor (detaches from VisIter)
79  ~CalVisBuffer();
80 
81  // Assignment, looses synchronization with iterator: only use buffer for
82  // current iteration (or reattach)
83  CalVisBuffer& operator=(const VisBuffer& cvb);
84 
85  // Assignment, optionally without copying the data across; with copy=true
86  // this is identical to normal assignment operator
88 
89  // Update (simple) coord info
90  // (this OVERRIDES VisBuffer::updateCoordInfo(), which does more)
91  void updateCoordInfo(const VisBuffer * vb = NULL, const casacore::Bool dirDependent=true);
92 
93  // Apply amp-only or phase-only to data
94  void enforceAPonData(const casacore::String& apmode);
95 
96  // Set the focus channel
97  // (forms references to focus-channel flag/data/model)
98  void setFocusChan(const casacore::Int focusChan=-1);
99 
100  // Size/init/finalize the residuals workspaces
101  void sizeResiduals(const casacore::Int& nPar,const casacore::Int& nDiff);
102  void initResidWithModel();
103  void finalizeResiduals();
104 
105  // Delete the workspaces
106  void cleanUp();
107 
108  // <group>
109  // Access functions
110  //
111 
112  // Access to focus-channel slices of the flags, data, and model
113  // casacore::Cube<casacore::Bool>& infocusFlagCube() { return infocusFlagCube_p; }
114  // const casacore::Cube<casacore::Bool>& infocusFlagCube() const {return this->infocusFlagCube();}
115 
118 
121 
124 
125  // Workspace for the residual visibilities
128 
129  // Workspace for flags of the residuals
132 
133  // Workspace for the differentiated residuals
136 
137  //</group>
138 
139 private:
140 
141  // The current in-focus channel
143 
144  // actual storage for the data
145  // casacore::Cube<casacore::Bool> infocusFlagCube_p;
149 
153 };
154 
155 
156 } //# NAMESPACE CASA - END
157 
158 #endif
159 
casacore::Matrix< casacore::Bool > residFlag_p
Definition: CalVisBuffer.h:151
casacore::Array< casacore::Complex > diffResiduals_p
Definition: CalVisBuffer.h:152
const casacore::Array< casacore::Complex > & diffResiduals() const
Definition: CalVisBuffer.h:135
const casacore::Matrix< casacore::Bool > & infocusFlag() const
Definition: CalVisBuffer.h:117
int Int
Definition: aipstype.h:50
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
casacore::Matrix< casacore::Bool > & residFlag()
Definition: CalVisBuffer.h:130
CalVisBuffer extends VisBuffer to support storage and recall of associated residual and differentiate...
Definition: CalVisBuffer.h:65
casacore::Cube< casacore::Complex > infocusVisCube_p
Definition: CalVisBuffer.h:147
virtual casacore::Int nPar()
M currently has just 2 complex parameters, i.e., both parallel hands.
casacore::Int focusChan_p
Definition: CalVisBuffer.h:142
CalVisBuffer & operator=(const VisBuffer &cvb)
Assignment, loses synchronization with iterator: only use buffer for current iteration (or reattach) ...
casacore::Cube< casacore::Complex > & infocusVisCube()
Definition: CalVisBuffer.h:119
casacore::Cube< casacore::Complex > & infocusModelVisCube()
Definition: CalVisBuffer.h:122
void sizeResiduals(const casacore::Int &nPar, const casacore::Int &nDiff)
casacore::Cube< casacore::Complex > residuals_p
Definition: CalVisBuffer.h:150
void enforceAPonData(const casacore::String &apmode)
casacore::Array< casacore::Complex > & diffResiduals()
Definition: CalVisBuffer.h:134
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Matrix< casacore::Bool > infocusFlag_p
Definition: CalVisBuffer.h:146
casacore::Cube< casacore::Complex > & residuals()
Definition: CalVisBuffer.h:126
casacore::Matrix< casacore::Bool > & infocusFlag()
Definition: CalVisBuffer.h:116
void setFocusChan(const casacore::Int focusChan=-1)
void updateCoordInfo(const VisBuffer *vb=NULL, const casacore::Bool dirDependent=true)
Update coordinate info - useful for copied VisBuffers that need to retain some state for later refere...
const casacore::Matrix< casacore::Bool > & residFlag() const
Definition: CalVisBuffer.h:131
const casacore::Cube< casacore::Complex > & infocusModelVisCube() const
Definition: CalVisBuffer.h:123
String: the storage and methods of handling collections of characters.
Definition: String.h:223
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
ROVisibilityIterator iterates through one or more readonly MeasurementSets.
const casacore::Cube< casacore::Complex > & infocusVisCube() const
Definition: CalVisBuffer.h:120
CalVisBuffer & assign(const VisBuffer &vb, casacore::Bool copy=true)
Assignment, optionally without copying the data across; with copy=true this is identical to normal as...
casacore::Cube< casacore::Complex > infocusModelVisCube_p
Definition: CalVisBuffer.h:148
const casacore::Cube< casacore::Complex > & residuals() const
Definition: CalVisBuffer.h:127