DP3
Counter.h
Go to the documentation of this file.
1 // Counter.h: DP3 step class to count flags
2 // Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy)
3 // SPDX-License-Identifier: GPL-3.0-or-later
4 
8 
9 #ifndef DP3_STEPS_COUNTER_H_
10 #define DP3_STEPS_COUNTER_H_
11 
12 #include "Step.h"
13 
14 #include "base/FlagCounter.h"
15 #include "common/ParameterSet.h"
16 
17 namespace dp3 {
18 namespace steps {
19 
21 
26 
27 class Counter : public Step {
28  public:
31  explicit Counter(const common::ParameterSet&, const std::string& prefix);
32 
33  ~Counter() override;
34 
35  common::Fields getRequiredFields() const override { return kFlagsField; }
36 
37  common::Fields getProvidedFields() const override { return {}; }
38 
41  bool process(std::unique_ptr<base::DPBuffer> buffer) override;
42 
44  void finish() override;
45 
47  void updateInfo(const base::DPInfo&) override;
48 
50  void show(std::ostream&) const override;
51 
53  void showCounts(std::ostream&) const override;
54 
55  private:
56  std::string name_;
57  unsigned int count_;
58  bool save_to_json_;
59  std::string json_filename_;
60  base::FlagCounter flag_counter_;
61 };
62 
63 } // namespace steps
64 } // namespace dp3
65 
66 #endif
Class to keep counts of nr of flagged points.
Class to hold code for virtual base class for Flaggers in DP3.
General info about DP3 data processing attributes like averaging.
Definition: DPInfo.h:35
Class to keep counts of nr of flagged points.
Definition: FlagCounter.h:35
Definition: Fields.h:16
Implements a map of Key-Value pairs.
Definition: ParameterSet.h:31
DPPP step class to count flags.
Definition: Counter.h:27
void finish() override
Finish the processing of this step and subsequent steps.
common::Fields getProvidedFields() const override
Definition: Counter.h:37
void show(std::ostream &) const override
Show the step parameters.
common::Fields getRequiredFields() const override
Get the fields required by the current step.
Definition: Counter.h:35
bool process(std::unique_ptr< base::DPBuffer > buffer) override
void showCounts(std::ostream &) const override
Show the flag counts.
Counter(const common::ParameterSet &, const std::string &prefix)
void updateInfo(const base::DPInfo &) override
Update the general info.
Abstract base class for a DP3 step.
Definition: Step.h:52
static constexpr dp3::common::Fields kFlagsField
Definition: Step.h:62
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53