DP3
MSBDAReader.h
Go to the documentation of this file.
1 // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
2 // SPDX-License-Identifier: GPL-3.0-or-later
3 
7 
8 #ifndef DPPP_MSBDAREADER_H
9 #define DPPP_MSBDAREADER_H
10 
11 #include "InputStep.h"
12 
13 #include "base/BdaBuffer.h"
14 #include "base/UVWCalculator.h"
15 #include "base/FlagCounter.h"
16 
17 #include <casacore/ms/MeasurementSets/MeasurementSet.h>
18 
19 #include <map>
20 
21 namespace dp3 {
22 namespace common {
23 class ParameterSet;
24 }
25 
26 namespace steps {
28 
97 
98 class MSBDAReader : public InputStep {
99  public:
102  MSBDAReader(const casacore::MeasurementSet& ms, const common::ParameterSet&,
103  const std::string& prefix);
104 
105  ~MSBDAReader() override;
106 
109  bool process(std::unique_ptr<base::DPBuffer> buffer) override;
110 
113  bool process(std::unique_ptr<base::BdaBuffer> buffer) override;
114 
116  void finish() override;
117 
119  MsType outputs() const override { return MsType::kBda; };
120 
123  void updateInfo(const base::DPInfo&) override;
124 
126  void show(std::ostream&) const override;
127 
129  void showTimings(std::ostream&, double duration) const override;
130 
132  std::string msName() const override;
133 
135  const casacore::Table& table() const override { return ms_; }
136 
137  private:
138  const casacore::MeasurementSet ms_;
139  std::string data_column_name_;
140  std::string weight_column_name_;
141  double last_ms_time_;
142  double last_ms_interval_;
143  bool is_interval_integer_;
144  unsigned int nread_;
145  common::NSTimer timer_;
146  std::size_t pool_size_;
147 
148  std::map<int, std::size_t>
149  desc_id_to_nchan_;
150  std::map<std::pair<int, int>, unsigned int>
151  bl_to_id_;
152 };
153 
154 } // namespace steps
155 } // namespace dp3
156 
157 #endif
Buffer holding baseline-dependently averaged (BDA) data.
Class to keep counts of nr of flagged points.
Abstract base class for a Step generating input.
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
Implements a map of Key-Value pairs.
Definition: ParameterSet.h:31
Abstract base class for a Step generating input.
Definition: InputStep.h:37
Step for reading BDA data from an MS.
Definition: MSBDAReader.h:98
bool process(std::unique_ptr< base::DPBuffer > buffer) override
void updateInfo(const base::DPInfo &) override
std::string msName() const override
Get the name of the MS.
MSBDAReader(const casacore::MeasurementSet &ms, const common::ParameterSet &, const std::string &prefix)
void finish() override
Finish the processing of this step and subsequent steps.
MsType outputs() const override
Return which datatype this step outputs.
Definition: MSBDAReader.h:119
bool process(std::unique_ptr< base::BdaBuffer > buffer) override
void showTimings(std::ostream &, double duration) const override
Show the timings.
const casacore::Table & table() const override
Get the main MS table.
Definition: MSBDAReader.h:135
void show(std::ostream &) const override
Show the step parameters.
MsType
To check compatibility between steps before running.
Definition: Step.h:57
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53