DP3
StationAdder.h
Go to the documentation of this file.
1 // StationAdder.h: DP3 step class to add stations as a superstation
2 // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
3 // SPDX-License-Identifier: GPL-3.0-or-later
4 
8 
9 #ifndef DP3_STEPS_STATIONADDER_H_
10 #define DP3_STEPS_STATIONADDER_H_
11 
12 #include <casacore/measures/Measures/MPosition.h>
13 
14 #include "base/DPBuffer.h"
15 #include "steps/Step.h"
16 
17 #include "base/UVWCalculator.h"
18 
19 #include "common/ParameterRecord.h"
20 #include "common/ParameterSet.h"
21 #include "common/Timer.h"
22 
23 namespace dp3 {
24 namespace steps {
26 
44 
45 class StationAdder : public Step {
46  public:
49  StationAdder(const common::ParameterSet&, const std::string& prefix);
50 
51  ~StationAdder() override;
52 
53  common::Fields getRequiredFields() const override {
55  }
56 
57  common::Fields getProvidedFields() const override {
59  }
60 
64  bool process(std::unique_ptr<base::DPBuffer> buffer) override;
65 
67  void finish() override;
68 
70  void addToMS(const std::string& msName) override;
71 
73  void updateInfo(const base::DPInfo&) override;
74 
76  void show(std::ostream&) const override;
77 
79  void showTimings(std::ostream&, double duration) const override;
80 
87  static std::vector<int> GetMatchingStations(
88  const std::vector<std::string>& antenna_names,
89  const std::vector<std::string>& patterns);
90 
91  private:
93  void updateBeamInfo(const std::string& msName, unsigned int origNant,
94  casacore::Table& antTab);
95 
96  std::string itsName;
97  common::ParameterRecord itsStatRec;
98  std::vector<casacore::Vector<int>>
99  itsParts;
100  std::vector<std::vector<int>>
101  itsBufRows;
102  unsigned int itsMinNPoint;
103  bool itsMakeAutoCorr;
104  bool itsSumAutoCorr;
105  bool itsDoAverage;
106  bool itsUseWeight;
107  std::unique_ptr<base::UVWCalculator> itsUVWCalc;
108  common::NSTimer itsTimer;
109 };
110 
111 } // namespace steps
112 } // namespace dp3
113 
114 #endif
Buffer holding the data of a timeslot/band.
Class to hold code for virtual base class for Flaggers in DP3.
Class to calculate UVW coordinates Note: this code is used by LOFAR and APERTIF software.
General info about DP3 data processing attributes like averaging.
Definition: DPInfo.h:35
Definition: Fields.h:16
A record of parameter values. The only difference with a ParameterSet is the output operator.
Definition: ParameterRecord.h:16
Implements a map of Key-Value pairs.
Definition: ParameterSet.h:31
DP3 step class to add stations as a superstation.
Definition: StationAdder.h:45
common::Fields getRequiredFields() const override
Get the fields required by the current step.
Definition: StationAdder.h:53
void finish() override
Finish the processing of this step and subsequent steps.
StationAdder(const common::ParameterSet &, const std::string &prefix)
void showTimings(std::ostream &, double duration) const override
Show the timings.
bool process(std::unique_ptr< base::DPBuffer > buffer) override
common::Fields getProvidedFields() const override
Definition: StationAdder.h:57
void show(std::ostream &) const override
Show the step parameters.
static std::vector< int > GetMatchingStations(const std::vector< std::string > &antenna_names, const std::vector< std::string > &patterns)
void updateInfo(const base::DPInfo &) override
Update the general info.
void addToMS(const std::string &msName) override
Add new meta info to the MS.
Abstract base class for a DP3 step.
Definition: Step.h:52
static constexpr dp3::common::Fields kWeightsField
Definition: Step.h:64
static constexpr dp3::common::Fields kUvwField
Definition: Step.h:66
static constexpr dp3::common::Fields kDataField
Definition: Step.h:60
static constexpr dp3::common::Fields kFlagsField
Definition: Step.h:62
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53