Source
22
22
//# National Radio Astronomy Observatory
23
23
//# 520 Edgemont Road
24
24
//# Charlottesville, VA 22903-2475 USA
25
25
//#
26
26
//#
27
27
28
28
#ifndef CALIBRATION_CALTABITER_H
29
29
#define CALIBRATION_CALTABITER_H
30
30
31
31
#include <casa/aips.h>
32
+
#include <measures/Measures/MEpoch.h>
33
+
#include <ms/MSOper/MSDerivedValues.h>
32
34
#include <tables/Tables/TableIter.h>
33
35
#include <synthesis/CalTables/NewCalTable.h>
34
36
#include <synthesis/CalTables/CTMainColumns.h>
35
37
#include <synthesis/CalTables/CTColumns.h>
36
38
37
39
namespace casa { //# NAMESPACE CASA - BEGIN
38
40
39
41
// <summary>
40
42
// ROCTIter: Read-only iterating interface to New Calibration tables
41
43
// </summary>
74
76
// </todo>
75
77
76
78
class ROCTIter
77
79
{
78
80
public:
79
81
// Constructor/Destructor
80
82
ROCTIter(NewCalTable tab,const casacore::Block<casacore::String>& sortcol);
81
83
virtual ~ROCTIter();
82
84
83
85
// Iteration operators
84
-
inline void reset() { ti_->reset(); this->attach(); };
86
+
inline void reset() { ti_->reset(); this->attach(); updatePhaseCenter(); };
85
87
inline casacore::Bool pastEnd() { return ti_->pastEnd(); };
86
88
void next();
87
89
void next0();
88
90
89
91
// Return the current table iteration
90
92
NewCalTable table() const { return NewCalTable(ti_->table()); };
91
93
92
94
casacore::Int nrow() const { return ti_->table().nrow(); };
93
95
94
96
// Column accessors
152
154
153
155
casacore::Cube<casacore::Bool> flag() const;
154
156
void flag(casacore::Cube<casacore::Bool>& c) const;
155
157
156
158
casacore::Int nchan() const;
157
159
casacore::Vector<casacore::Int> chan() const;
158
160
void chan(casacore::Vector<casacore::Int>& v) const;
159
161
casacore::Vector<casacore::Double> freq() const;
160
162
void freq(casacore::Vector<casacore::Double>& v) const;
161
163
164
+
casacore::MDirection azel0(casacore::Double time) const;
165
+
casacore::Double hourang(casacore::Double time) const;
166
+
casacore::Float parang0(casacore::Double time) const;
167
+
162
168
protected:
163
169
164
170
// Attach accessors
165
171
virtual void attach();
166
172
167
173
private:
168
174
169
175
// Prohibit public use of copy, assignment
170
176
ROCTIter (const ROCTIter& other);
171
177
ROCTIter& operator= (const ROCTIter& other);
172
178
173
-
// casacore::Data:
179
+
// Update phase center in MSDerivedValues
180
+
void updatePhaseCenter();
174
181
175
182
// Remember the sort columns...
176
183
casacore::Vector<casacore::String> sortCols_;
177
184
178
185
// If true, spw is unique per iteration, and it is
179
186
// safe to access channel axis info
180
187
casacore::Bool singleSpw_;
181
188
182
189
// The parent NewCalTable (casacore::Table) object
183
190
// (stays in scope for the life of the CTIter)
188
195
189
196
// The underlying TableIterator
190
197
casacore::TableIterator *ti_;
191
198
192
199
// Per-iteration table
193
200
NewCalTable *inct_;
194
201
195
202
// Per-iteration columns
196
203
ROCTMainColumns *iROCTMainCols_;
197
204
198
-
205
+
// For calculating az, el, hourang, parang
206
+
casacore::MSDerivedValues* msd_;
207
+
casacore::MEpoch epoch_;
208
+
casacore::Int lastfield_;
199
209
};
200
210
201
211
// Writable version (limited to certain 'columns')
202
212
class CTIter : public ROCTIter
203
213
{
204
214
public:
205
215
// Constructor/Destructor
206
216
CTIter(NewCalTable tab,const casacore::Block<casacore::String>& sortcol);
207
217
virtual ~CTIter();
208
218