DP3
FlagTransfer.h
Go to the documentation of this file.
1 // FlagTransfer.h: DP3 step class to transfer flags
2 // Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy)
3 // SPDX-License-Identifier: GPL-3.0-or-later
4 
9 
10 #ifndef DP3_STEPS_FLAG_TRANSFER_H_
11 #define DP3_STEPS_FLAG_TRANSFER_H_
12 
13 #include <casacore/ms/MeasurementSets/MeasurementSet.h>
14 #include <casacore/tables/Tables/TableIter.h>
15 #include "base/DPBuffer.h"
16 #include "steps/Step.h"
17 #include "Filter.h"
18 #include "ResultStep.h"
19 #include "common/Timer.h"
20 
21 namespace dp3 {
22 
23 namespace common {
24 class ParameterSet;
25 }
26 
27 namespace steps {
28 
31 
37 
40 
41 class FlagTransfer final : public Step {
42  public:
45  explicit FlagTransfer(const common::ParameterSet& parameter_set,
46  const std::string& prefix);
47 
49  return filter_step_->getRequiredFields();
50  }
51 
52  common::Fields getProvidedFields() const final { return kFlagsField; }
53 
54  bool process(std::unique_ptr<base::DPBuffer> buffer) final;
55 
56  void finish() final;
57 
58  void updateInfo(const base::DPInfo&) final;
59 
60  void show(std::ostream&) const final;
61 
62  void showTimings(std::ostream&, double duration) const final;
63 
64  private:
66  void ReadSourceMsFlags();
67 
68  std::string name_;
69  common::NSTimer timer_;
70  std::string source_ms_path_;
71  casacore::MeasurementSet ms_;
72  casacore::TableIterator ms_iterator_;
73 
76  base::DPBuffer::FlagsType flags_;
77 
79  std::size_t timestep_counter_;
80 
82  std::size_t time_averaging_factor_;
83 
85  double time_interval_;
86 
88  std::vector<double> source_channel_upper_edges_;
89 
90  std::shared_ptr<Step> filter_step_;
91  std::shared_ptr<ResultStep> result_step_;
92 };
93 
94 } // namespace steps
95 } // namespace dp3
96 
97 #endif
Buffer holding the data of a timeslot/band.
DP3 step to filter out baselines and channels.
Class to hold code for virtual base class for Flaggers in DP3.
Definition: Fields.h:16
Implements a map of Key-Value pairs.
Definition: ParameterSet.h:31
DP3 step class to transfer flags from a lower to a MS with higher time/freq resolution.
Definition: FlagTransfer.h:41
void show(std::ostream &) const final
Show the step parameters.
common::Fields getProvidedFields() const final
Definition: FlagTransfer.h:52
void showTimings(std::ostream &, double duration) const final
FlagTransfer(const common::ParameterSet &parameter_set, const std::string &prefix)
common::Fields getRequiredFields() const final
Get the fields required by the current step.
Definition: FlagTransfer.h:48
bool process(std::unique_ptr< base::DPBuffer > buffer) final
void finish() final
Finish the processing of this step and subsequent steps.
void updateInfo(const base::DPInfo &) final
This class defines a step in the DP3 pipeline that keeps the result to make it possible to get the re...
Definition: ResultStep.h:16
Abstract base class for a DP3 step.
Definition: Step.h:52
static constexpr dp3::common::Fields kFlagsField
Definition: Step.h:62
Definition: InputStep.h:21
BaseTimer< std::chrono::steady_clock > NSTimer
Definition: Timer.h:129
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53