casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalIntpMatch.h
Go to the documentation of this file.
1 //# CalIntpMatch.h: A class to hold calibration interpolation index maps
2 //# Copyright (C) 1996,1997,1998,1999,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: 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 //#
27 //# $Id$
28 
29 #ifndef CALIBRATION_CALINTPMATCH_H
30 #define CALIBRATION_CALINTPMATCH_H
31 
32 #include <casa/aips.h>
33 #include <casa/Arrays/Vector.h>
34 #include <casa/Arrays/LogiArray.h>
35 #include <casa/Containers/Record.h>
36 #include <ms/MSSel/MSSelection.h>
37 #include <msvis/MSVis/VisBuffer.h>
39 
40 namespace casacore{
41 
42 // by class MSSelection). The CalIntpMatch class has a match methods,
43 }
44 
45 namespace casa { //# NAMESPACE CASA - BEGIN
46 
47 // <summary>
48 // CalIntpMatch: a class to hold calibration interpolation index maps
49 // </summary>
50 
51 // <use visibility=export>
52 
53 // <reviewed reviewer="" date="" tests="" demos="">
54 
55 // <prerequisite>
56 // <li> <linkto class="MSCalEnums">MSCalEnums</linkto> module
57 // <li> <linkto class="VisBuffer">VisBuffer</linkto> module
58 // <li> <linkto class="CalMainBuffer">CalMainBuffer</linkto> module
59 // <li> <linkto class="casacore::MSSelection">casacore::MSSelection</linkto> module
60 // </prerequisite>
61 //
62 // <etymology>
63 // From "calibration", "interpolation index" and "match".
64 // </etymology>
65 //
66 // <synopsis>
67 // The CalIntpMatch class holds calibration interpolation index maps.
68 // These define which subset of calibration table rows are associated
69 // with any given visibility row, i.e. which data and calibration
70 // indices need to match in selecting calibration for a given visibility
71 // record. The map type is defined in terms of an enumerated set of
72 // possibilities, including for example, requiring an exact match between
73 // the antenna and spectral window id.'s. The most general interpolation
74 // map is defined by a matching set of synthesis selections (as defined
75 // matchIndex() and calRows() which determine, for associated calibration
76 // and visibility buffers, the calibration row mapping for a given visibility.
77 // </synopsis>
78 //
79 // <example>
80 // <srcblock>
81 // </srcblock>
82 // </example>
83 //
84 // <motivation>
85 // Encapsulate match operations for calibration and visibility data indices.
86 // </motivation>
87 //
88 // <todo asof="2002/05/01">
89 // (i) Expand the range of enumerated mappings.
90 // </todo>
91 
93 {
94  public:
95 
96  // Basic interpolation index match type
97  enum MatchType {
98  // ANTENNA_ID and SPECTRAL_WINDOW_ID to match identically
100 
101  // Custom mapping between arbitrary visibility and calibration selections
103  };
104 
105  // Construct from an index match type and an index dimension. The
106  // index dimension is one for baseline-based calibration and two
107  // for antenna-based calibration.
108  CalIntpMatch (const MatchType& matchType = MATCHING_ANT_SPW,
109  const casacore::uInt& indexDim = 2);
110 
111  // Destructor
112  virtual ~CalIntpMatch();
113 
114  // Copy constructor and assignment operator
115  CalIntpMatch (const CalIntpMatch& other);
116  virtual CalIntpMatch& operator= (const CalIntpMatch& other);
117 
118  // Reset the mapping type
119  void setType (const MatchType& matchType, const casacore::uInt& indexDim);
120 
121  // Add a selection mapping (NYI)
122  // void add (const casacore::MSSelection& msIndex, const casacore::MSSelection& calIndex);
123 
124  // Set the current visibility buffer to be used in interpolation matches
125  void setVisBuffer (VisBuffer& vb);
126 
127  // Set the current calibration buffer to be used in interpolation matches
128  void setCalBuffer (CalMainBuffer& cb);
129 
130  // Return the match index for a given visibility buffer
131  // row and offset position (0,1)
133  {return vbIndex_p(row,pos);};
134 
135  // Return the calibration buffer rows (and equivalent row mask)
136  // associated with a given match index
137  casacore::Vector<casacore::Int> calRows (const casacore::Int& matchIndex, casacore::LogicalArray& calRowMask);
138 
139  protected:
140 
141  private:
142  // Common code for the assignment operator and the copy constructor
143  void copy (const CalIntpMatch& other);
144  void free();
145 
146  // Reset functions for the local index mappings
147  void reset();
148  void resetVisIndex();
149  void resetCalIndex();
150 
151  // Match index keys
153 
154  // Index map type
156 
157  // Index dimension (one for baseline-based calibration and
158  // two for antenna-based calibration).
160 
161  // casacore::Map index assignment per visibility buffer row
163 
164  // casacore::Map index assignment per calibration buffer row
166 
167  // casacore::List of visibility and calibration match keys
169 
170  // Pointer to the current VisBuffer
172 
173  // Pointer to the current CalMainBuffer
175 };
176 
177 
178 } //# NAMESPACE CASA - END
179 
180 #endif
181 
int Int
Definition: aipstype.h:50
virtual ~CalIntpMatch()
Destructor.
MatchType type_p
Index map type.
Definition: CalIntpMatch.h:155
VisBuffer * vb_p
Pointer to the current VisBuffer.
Definition: CalIntpMatch.h:171
casacore::Vector< casacore::Int > calRows(const casacore::Int &matchIndex, casacore::LogicalArray &calRowMask)
Return the calibration buffer rows (and equivalent row mask) associated with a given match index...
void setCalBuffer(CalMainBuffer &cb)
Set the current calibration buffer to be used in interpolation matches.
void reset()
Reset functions for the local index mappings.
casacore::Block< casacore::Vector< casacore::Int > > cbIndex_p
casacore::Map index assignment per calibration buffer row
Definition: CalIntpMatch.h:165
void copy(const CalIntpMatch &other)
Common code for the assignment operator and the copy constructor.
casacore::Int matchOrAddKey(const casacore::Record &key)
Match index keys.
Custom mapping between arbitrary visibility and calibration selections.
Definition: CalIntpMatch.h:102
casacore::Int matchIndex(const casacore::Int &row, const casacore::uInt &pos)
Return the match index for a given visibility buffer row and offset position (0,1) ...
Definition: CalIntpMatch.h:132
void setVisBuffer(VisBuffer &vb)
Add a selection mapping (NYI) void add (const casacore::MSSelection&amp; msIndex, const casacore::MSSelec...
CalIntpMatch: a class to hold calibration interpolation index maps.
Definition: CalIntpMatch.h:92
ANTENNA_ID and SPECTRAL_WINDOW_ID to match identically.
Definition: CalIntpMatch.h:99
casacore::Int indexDim_p
Index dimension (one for baseline-based calibration and two for antenna-based calibration).
Definition: CalIntpMatch.h:159
virtual CalIntpMatch & operator=(const CalIntpMatch &other)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
casacore::Matrix< casacore::Int > vbIndex_p
casacore::Map index assignment per visibility buffer row
Definition: CalIntpMatch.h:162
CalMainBuffer: Calibration main table buffer.
Definition: CalMainBuffer.h:80
A drop-in replacement for Block&lt;T*&gt;.
Definition: WProjectFT.h:54
CalIntpMatch(const MatchType &matchType=MATCHING_ANT_SPW, const casacore::uInt &indexDim=2)
Construct from an index match type and an index dimension.
simple 1-D array
CalMainBuffer * cb_p
Pointer to the current CalMainBuffer.
Definition: CalIntpMatch.h:174
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
MatchType
Basic interpolation index match type.
Definition: CalIntpMatch.h:97
void setType(const MatchType &matchType, const casacore::uInt &indexDim)
Reset the mapping type.
casacore::PtrBlock< casacore::Record * > matchKeys_p
casacore::List of visibility and calibration match keys
Definition: CalIntpMatch.h:168
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42