casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FinalTvi2.h
Go to the documentation of this file.
1 //# VisibilityIterator.h: Step through the MeasurementEquation by visibility
2 //# Copyright (C) 1996,1997,1998,1999,2000,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 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: VisibilityIterator2.h,v 19.14 2006/02/28 04:48:58 mvoronko Exp $
27 
28 #if ! defined (MSVIS_WritingVi2_H_121115_0950)
29 #define MSVIS_WritingVi2_H_121115_0950
30 
31 #include <casa/aips.h>
32 #include <ms/MeasurementSets.h>
34 #include <msvis/MSVis/ViColumns2.h>
35 
36 #include <map>
37 #include <vector>
38 
39 namespace casacore{
40 
41 template <typename T> class Vector;
42 }
43 
44 namespace casa { //# NAMESPACE CASA - BEGIN
45 
46 
47 namespace vi {
48 
49 //# forward decl
50 
51 class VisBuffer2;
52 
53 class ChannelSelector;
54 class ChannelSelectorCache;
56 class SpectralWindowChannelsCache;
57 class SpectralWindowChannels;
58 class SubtableColumns;
59 
60 
61 // <summary>
62 // FinalTvi2 - Class that serves as the final Tvi2 in a pipeline; it adds simple write functionality that
63 // allows writing back the data contained in the associated VB2.
64 // </summary>
65 
66 // <use visibility=export>
67 
68 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
69 // </reviewed>
70 
71 // <prerequisite>
72 // </prerequisite>
73 //
74 // <etymology>
75 // The FinalTvi2 in a transforming VI2 pipeline.
76 // </etymology>
77 //
78 // <synopsis>
79 // </synopsis>
80 //
81 // <example>
82 // <code>
83 // //
84 // </code>
85 // </example>
86 //
87 // <motivation>
88 // At the end of a Transforming VI pipeline it can be handy to write out the result. Putting a FinalTvi2
89 // as the last transforming VI allows the output to disk of the transformed data into a brand new MS.
90 // </motivation>
91 //
92 // <thrown>
93 // <li>
94 // <li>
95 // </thrown>
96 //
97 // <todo asof="2014/08/21">
98 // </todo>
99 
100 class FinalTvi2 : public TransformingVi2 {
101 
102 public:
103 
104  FinalTvi2 (ViImplementation2 * inputVi,
105  casacore::MeasurementSet & finalMs,
107 
108  // Destructor
109 
110  virtual ~FinalTvi2 ();
111 
112  // +==================================+
113  // | |
114  // | Iteration Control and Monitoring |
115  // | |
116  // +==================================+
117 
118 
119  virtual void origin ();
120  virtual void next ();
121 
122  // +=========================+
123  // | |
124  // | Subchunk casacore::Data Accessors |
125  // | |
126  // +=========================+
127 
128 
129  // +------------------------+
130  // | |
131  // | Angular casacore::Data Providers |
132  // | |
133  // +------------------------+
134 
135 
136  // +=========================+
137  // | |
138  // | Chunk and casacore::MS Level casacore::Data |
139  // | |
140  // +=========================+
141 
142 
143 
144  // +-------------------+
145  // | |
146  // | Writeback Methods |
147  // | |
148  // +-------------------+
149 
150  // This method writes back any changed (dirty) components of the provided
151  // VisBuffer and is the preferred method for writing data out.
152 
153  virtual void writeBackChanges (VisBuffer2 * vb);
154 
155  // These methods will throw a not-implemented exception if called. They are here
156  // because the interface requires them but the intended use of FinalTvi2 expects
157  // that the data will be output using only the writeBackChanges method.
158 
159  virtual void writeFlag (const casacore::Matrix<casacore::Bool> & flag);
160  virtual void writeFlag (const casacore::Cube<casacore::Bool> & flag);
161  virtual void writeFlagRow (const casacore::Vector<casacore::Bool> & rowflags);
162  virtual void writeFlagCategory(const casacore::Array<casacore::Bool>& fc);
163  virtual void writeVisCorrected (const casacore::Cube<casacore::Complex> & vis);
164  virtual void writeVisModel (const casacore::Cube<casacore::Complex> & vis);
165  virtual void writeVisObserved (const casacore::Cube<casacore::Complex> & vis);
166  virtual void writeWeight (const casacore::Matrix<casacore::Float> & wt);
167  virtual void writeWeightSpectrum (const casacore::Cube<casacore::Float> & wtsp);
168  virtual void writeSigma (const casacore::Matrix <casacore::Float> & sig);
169  virtual void writeModel(const casacore::RecordInterface& rec, casacore::Bool iscomponentlist=true,
170  casacore::Bool incremental=false);
171 
172 protected:
173 
174  //void configureNewSubchunk ();
175 
176  // These are the methods that actually write the data in the VB2 out to the new
177  // casacore::MS when called by writeBackChanges. The VB's data are handled as four categories:
178  // data - the various visibility data and the associated weight, weight spectrum, sigma, etc.
179  // keys - the values of the columns that ID the row (e.g., antennas, DdId, etc.)
180  // misc - the column values that don't fall in the data or key categories.
181 
185 
186 private:
187 
191 
192 };
193 
194 } // end namespace vi
195 
196 } //# NAMESPACE CASA - END
197 
198 #endif // ! defined (MSVIS_WritingVi2_H_121115_0950)
199 
200 
A 1-D Specialization of the Array class.
virtual casacore::Bool isWritable() const override
virtual ~FinalTvi2()
Destructor.
std::vector< double > Vector
Definition: ds9context.h:24
casacore::Bool columnsAttached_p
Definition: FinalTvi2.h:189
virtual void writeVisObserved(const casacore::Cube< casacore::Complex > &vis)
FinalTvi2 - Class that serves as the final Tvi2 in a pipeline; it adds simple write functionality tha...
Definition: FinalTvi2.h:100
virtual void writeModel(const casacore::RecordInterface &rec, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false)
Write/modify the ncorr x nrow SigmaMat.
void writeMiscellaneousValues(casacore::MeasurementSet &ms, const casacore::RefRows &rows)
virtual void flag(casacore::Cube< casacore::Bool > &flags) const override
Return flag for each polarization, channel and row.
virtual void writeWeight(const casacore::Matrix< casacore::Float > &wt)
Write/modify the weights.
virtual void writeSigma(const casacore::Matrix< casacore::Float > &sig)
Write/modify the Sigma.
virtual void writeVisCorrected(const casacore::Cube< casacore::Complex > &vis)
Write/modify the visibilities.
void writeDataValues(casacore::MeasurementSet &ms, const casacore::RefRows &rows)
void configureNewSubchunk ();
virtual void writeFlag(const casacore::Matrix< casacore::Bool > &flag)
These methods will throw a not-implemented exception if called.
casacore::MeasurementSet ms_p
Definition: FinalTvi2.h:190
ViColumns2 columns_p
Definition: FinalTvi2.h:188
virtual void writeFlagRow(const casacore::Vector< casacore::Bool > &rowflags)
Write/modify the flag row column; dimension casacore::Vector (nrow)
virtual void next()
Class holding the row numbers in a RefTable.
Definition: RefRows.h:85
virtual void writeWeightSpectrum(const casacore::Cube< casacore::Float > &wtsp)
Write/modify the weightMat virtual void writeWeightMat (const casacore::Matrix&lt;casacore::Float&gt; &amp; wt...
void writeKeyValues(casacore::MeasurementSet &ms, const casacore::RefRows &rows)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
FinalTvi2(ViImplementation2 *inputVi, casacore::MeasurementSet &finalMs, casacore::Bool isWritable)
virtual void writeVisModel(const casacore::Cube< casacore::Complex > &vis)
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
casacore::Vector< casacore::Vector< casacore::Slice > > ChannelSlicer
Definition: PolAverageTVI.h:56
A Table intended to hold astronomical data (a set of Measurements).
virtual void writeFlagCategory(const casacore::Array< casacore::Bool > &fc)
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
virtual void writeBackChanges(VisBuffer2 *vb)
+=========================+ | | | Subchunk casacore::Data Accessors | | | +=========================+...
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
virtual void origin()
+==================================+ | | | Iteration Control and Monitoring | | | +==================...
Abstract base class for Record classes.
virtual const casacore::MeasurementSet & ms() const override
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42