casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PointingInterpolationTVI.h
Go to the documentation of this file.
1 #ifndef POINTINGINTERPOLATIONTVI_H_
2 #define POINTINGINTERPOLATIONTVI_H_
3 
4 
5 
6 #include <casacore/casa/aips.h>
7 
9 
13 
15 
16 
17 namespace casa {
18 
19 namespace vi {
20 
21 using casacore::Vector;
22 using casacore::Double;
23 
24 
25 
27 
28 public:
29  class Interpolator {
30  public:
31  using PointingTimes = Vector<Double>; // pointingsCount[antId]
33  using PointingDirs = Vector<PointingDir>; // pointingsCount[antId]
34  Interpolator();
35 
36  enum class InterpMethod {
37  NEAREST,
39  };
40 
41  void setInterpMethod(InterpMethod method);
43 
44  void setData(const Vector<PointingTimes> &antsTimes, // nAnt
45  const Vector<PointingDirs> &antsDirs, // nAnt
46  const Vector<bool> &antSelected); // nAnt
47 
48  // Interpolation
49  Vector<Double> pointingDir(int ant,double time) const;
50  double nearestPointingTimeStamp() const;
51  private:
52  void clear();
53  void init(const Vector<bool> &antSelected = Vector<bool>());
56  using SplineCoeffs = Vector<DirSegmentCoeffs>; // pointingsCount[antId] - 1
57  void computeSplineCoeffs(const PointingTimes& timeStamps,
58  const PointingDirs& dirs,
59  SplineCoeffs& coeffs);
65  mutable double nearestPointingTimeStamp_;
66  };
67 
68 public:
71 
72  virtual casacore::String ViiType() const ;
73 
74  // Sub-chunk navigation methods
75  virtual void origin();
76  virtual void next();
77 
80 
81  virtual std::pair<bool, casacore::MDirection> getPointingAngle (int antenna, double time) const;
82 
83 private:
87  // Output Reference Frame
89  void setupInterpolator();
90  // Utilities
91  casacore::String taQLSet(const std::set<int> &);
92  // Interpolator
94 };
95 
97 
98 public:
99  // Constructor
101  ViImplementation2 *inputVII);
103  const casacore::MeasurementSet *ms, const SortColumns &sortColumns,
104  casacore::Double timeInterval, casacore::Bool isWritable);
105 
106  // Destructor
108 
109  ViImplementation2 * createVi() const;
110 
111 private:
112 
115 
116 };
117 
119 
120 public:
123 
124 protected:
125 
127 
129 
130 };
131 
132 } // namespace vi
133 
134 } // namespace casa
135 
136 #endif /* POINTINGINTERPOLATIONTVI_H_ */
std::vector< double > Vector
Definition: ds9context.h:24
void computeSplineCoeffs(const PointingTimes &timeStamps, const PointingDirs &dirs, SplineCoeffs &coeffs)
ViImplementation2 * createVi() const
PointingInterpolationVi2Factory(casacore::Record const &configuration, ViImplementation2 *inputVII)
Constructor.
casacore::String taQLSet(const std::set< int > &)
Utilities.
virtual void time(casacore::Vector< double > &t) const override
Return MJD midpoint of interval.
virtual void origin()
Sub-chunk navigation methods.
PointingInterpolationTVI::Interpolator interpolator_
Interpolator.
void setOutputDirectionFrame(casacore::MDirection::Types toRefType)
casacore::MDirection::Ref toRef_
Output Reference Frame.
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
defines physical units
Definition: Unit.h:189
Vector< Double > pointingDir(int ant, double time) const
Interpolation.
void setData(const Vector< PointingTimes > &antsTimes, const Vector< PointingDirs > &antsDirs, const Vector< bool > &antSelected)
void init(const Vector< bool > &antSelected=Vector< bool >())
double Double
Definition: aipstype.h:55
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
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
PointingInterpolationTVI(ViImplementation2 *inputVi)
virtual std::pair< bool, casacore::MDirection > getPointingAngle(int antenna, double time) const
A Table intended to hold astronomical data (a set of Measurements).
virtual casacore::String ViiType() const
Report the the ViImplementation type (should be specialized in child classes)
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
ViImplementation2 * createInstance(ViImplementation2 *vii0) const
Make a ViImplementation with another as input Must be specialized for each type.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
PointingInterpolationTVI::Interpolator & getInterpolator()
PointingInterpolationTVILayerFactory(casacore::Record const &configuration)