casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalibratingVi2Factory.h
Go to the documentation of this file.
1 //# CalibratingVi2Factory.h: Interface definition of the CalibratingVi2Factory class.
2 //#
3 //# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
4 //# Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved.
5 //# Copyright (C) European Southern Observatory, 2011, All rights reserved.
6 //#
7 //# This library is free software; you can redistribute it and/or
8 //# modify it under the terms of the GNU Lesser General Public
9 //# License as published by the Free software Foundation; either
10 //# version 2.1 of the License, or (at your option) any later version.
11 //#
12 //# This library is distributed in the hope that it will be useful,
13 //# but WITHOUT ANY WARRANTY, without even the implied warranty of
14 //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 //# Lesser General Public License for more details.
16 //#
17 //# You should have received a copy of the GNU Lesser General Public
18 //# License along with this library; if not, write to the Free Software
19 //# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 //# MA 02111-1307 USA
21 //# $Id: $
22 
23 #ifndef CalibratingVi2Factory_H_
24 #define CalibratingVi2Factory_H_
25 
26 // Where ViFactory interface is defined
30 
31 
32 // Implementation returned by the factory method
34 
35 
36 namespace casa { //# NAMESPACE CASA - BEGIN
37 namespace vi { //# NAMESPACE VI - BEGIN
38 
39 // <summary>
40 // A top level class defining the data handling interface for the CalibratingTvi2 module
41 // </summary>
42 //
43 // <use visibility=export>
44 //
45 // <prerequisite>
46 // <li> <linkto class="VisibilityIterator2:description">VisibilityIterator2</linkto>
47 // <li> <linkto class="CalibratingVi2:description">CalibratingVi2</linkto>
48 // </prerequisite>
49 //
50 // <etymology>
51 // CalibratingVi2Factory is a class that generates a Visibility Iterator implementation
52 // that can calibrate data
53 // </etymology>
54 //
55 // <synopsis>
56 // CalibratingVi2Factory generates a Visibility Iterator implementation (ViImplementation2)
57 // object that can be plugged into a Visibility Iterator (VisibilityIterator2) object,
58 // so that the user can access _corrected_ data (and related) using the VisibilityIterator2
59 // interface.
60 // </synopsis>
61 //
62 // <motivation>
63 // This class makes calibration application portable, and available for all VisibilityIterator2
64 // users
65 // </motivation>
66 //
67 // <example>
68 // External usage is quite simple, and compliant with the 'normal' VI/VB framework.
69 //
70 // The user first makes objects describing the data iteration and calibration parameters:
71 //
72 // <srcblock>
73 // IteratingParameters iterpar;
74 // iterpar.setChunkInterval(60.0);
75 //
76 // CalibratingParameters calpar(10.0); // a simple factor of 10.0 to multiply the data
77 // // (in leiu of full VisEquation functionality (TBD)
78 //
79 //
80 // </srcblock>
81 //
82 // Then these parameter objects, along with a casacore::MeasurementSet pointer, are used to make
83 // a factory suitable for the generic VisibilityIterator2 ctor, which is then invoked
84 //
85 // <srcblock>
86 // CalibratingVi2Factory factory(ms,calpar,iterpar);
87 // vi::VisibilityIterator2 *visIter = new vi::VisibilityIterator2 (factory);
88 // vi::VisBuffer2 *visBuffer = visIter->getVisBuffer();
89 // </srcblock>
90 //
91 // Once this is done one can normally iterate and access OTF calibrated data:
92 //
93 // <srcblock>
94 // while (visIter->moreChunks())
95 // {
96 // visIter->origin();
97 //
98 // while (visIter->more())
99 // {
100 //
101 // casacore::Vector<casacore::Int> ddi = visBuffer->dataDescriptionIds();
102 // casacore::Vector<casacore::Int> antenna1 = visBuffer->antenna1();
103 // casacore::Vector<casacore::Int> antenna2 = visBuffer->antenna2();
104 // casacore::Cube<casacore::Complex> cvis = visBuffer->visCubeCorrected();
105 //
106 // visIter->next();
107 // }
108 //
109 // visIter->nextChunk();
110 // }
111 // </srcblock>
112 //
113 //
114 // casacore::Notice that it is the responsibility of the application layer to delete the VisibilityIterator2
115 // pointer returned by the factory method. However the life cycle of the VisBuffer2 object is
116 // responsibility of the VisibilityIterator2 object.
117 //
118 // <srcblock>
119 // delete visIter;
120 // </srcblock>
121 //
122 // </example>
123 
125 {
126 
127 public:
128 
130  const CalibratingParameters& calpar,
131  const IteratingParameters& iterpar=IteratingParameters());
132 
134 
136  const casacore::Record& calrec,
137  const IteratingParameters& iterpar=IteratingParameters());
138 
140  const casacore::String& callib,
141  const IteratingParameters& iterpar=IteratingParameters());
142 
143  virtual ~CalibratingVi2Factory();
144 
145  // Public functions to initialize a generic CVi2F
146  virtual void initialize(casacore::MeasurementSet* ms,
147  const casacore::Record& calrec,
148  const IteratingParameters& iterpar);
149  virtual void initialize(casacore::MeasurementSet* ms,
150  const casacore::String& callib,
151  const IteratingParameters& iterpar);
152 
153 
154 
155 protected:
156 
157  // Create CalibratingVi2 implementation
158  // If vii=NULL, create underlying vii internally
159  virtual vi::ViImplementation2 * createVi () const;
160  virtual vi::ViImplementation2 * createVi (vi::ViImplementation2 * vii) const;
161 
162 private:
163 
168 
169 };
170 
171 
172 } //# NAMESPACE VI - END
173 } //# NAMESPACE CASA - END
174 
175 
176 #endif /* CalibratingVi2Factory_H_ */
177 
casacore::MeasurementSet * ms_p
A top level class defining the data handling interface for the CalibratingTvi2 module.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
A Table intended to hold astronomical data (a set of Measurements).
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void initialize(casacore::MeasurementSet *ms, const casacore::Record &calrec, const IteratingParameters &iterpar)
Public functions to initialize a generic CVi2F.
virtual vi::ViImplementation2 * createVi() const
Create CalibratingVi2 implementation If vii=NULL, create underlying vii internally.