DP3
PhaseShift.h
Go to the documentation of this file.
1 // PhaseShift.h: DPPP step class to shift the data to another phase center
2 // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
3 // SPDX-License-Identifier: GPL-3.0-or-later
4 
7 
8 #ifndef DP3_STEPS_PHASESHIFT_H_
9 #define DP3_STEPS_PHASESHIFT_H_
10 
11 #include "InputStep.h"
12 
13 #include "base/DPBuffer.h"
14 
15 #include <aocommon/staticfor.h>
16 
17 #include <casacore/casa/Arrays/Matrix.h>
18 
19 namespace dp3 {
20 namespace base {
21 struct Direction;
22 }
23 
24 namespace common {
25 class ParameterSet;
26 }
27 
28 namespace steps {
29 
31 
36 
37 class PhaseShift : public Step {
38  public:
42  PhaseShift(const common::ParameterSet&, const std::string& prefix);
43 
48  PhaseShift(const common::ParameterSet&, const std::string& prefix,
49  const std::vector<std::string>& defVal);
50 
51  ~PhaseShift() override;
52 
53  common::Fields getRequiredFields() const override {
54  return kDataField | kUvwField;
55  }
56 
57  common::Fields getProvidedFields() const override {
58  return kDataField | kUvwField;
59  }
60 
64  bool process(std::unique_ptr<base::DPBuffer> buffer) override;
65 
67  void finish() override;
68 
70  void updateInfo(const base::DPInfo&) override;
71 
73  void show(std::ostream&) const override;
74 
76  void showTimings(std::ostream&, double duration) const override;
77 
79  static void fillEulerMatrix(casacore::Matrix<double>& mat,
80  const base::Direction& direction);
81 
84  const xt::xtensor<std::complex<double>, 2>& getPhasors() const {
85  return itsPhasors;
86  }
87 
89  const std::vector<std::string>& getPhaseCenter() const { return itsCenter; }
90 
91  private:
94  casacore::MDirection handleCenter();
95 
96  std::string itsName;
97  std::vector<std::string> itsCenter;
98  std::vector<double> itsFreqC;
99  casacore::Matrix<double> itsEulerMatrix;
100  double itsXYZ[3];
101  xt::xtensor<std::complex<double>, 2>
102  itsPhasors;
103  common::NSTimer itsTimer;
104 };
105 
106 } // namespace steps
107 } // namespace dp3
108 
109 #endif
Buffer holding the data of a timeslot/band.
Abstract base class for a Step generating input.
General info about DP3 data processing attributes like averaging.
Definition: DPInfo.h:35
Definition: Fields.h:16
Implements a map of Key-Value pairs.
Definition: ParameterSet.h:31
DP3 step class to shift the data to another phase center.
Definition: PhaseShift.h:37
void updateInfo(const base::DPInfo &) override
Update the general info.
void showTimings(std::ostream &, double duration) const override
Show the timings.
PhaseShift(const common::ParameterSet &, const std::string &prefix)
PhaseShift(const common::ParameterSet &, const std::string &prefix, const std::vector< std::string > &defVal)
bool process(std::unique_ptr< base::DPBuffer > buffer) override
common::Fields getProvidedFields() const override
Definition: PhaseShift.h:57
const xt::xtensor< std::complex< double >, 2 > & getPhasors() const
Definition: PhaseShift.h:84
const std::vector< std::string > & getPhaseCenter() const
Get the phase center.
Definition: PhaseShift.h:89
common::Fields getRequiredFields() const override
Get the fields required by the current step.
Definition: PhaseShift.h:53
void show(std::ostream &) const override
Show the step parameters.
static void fillEulerMatrix(casacore::Matrix< double > &mat, const base::Direction &direction)
Fill the Euler rotation matrix for given ra/dec.
void finish() override
Finish the processing of this step and subsequent steps.
Abstract base class for a DP3 step.
Definition: Step.h:52
static constexpr dp3::common::Fields kUvwField
Definition: Step.h:66
static constexpr dp3::common::Fields kDataField
Definition: Step.h:60
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53
A direction on the celestial sphere.
Definition: Direction.h:15