DP3
Clipper.h
Go to the documentation of this file.
1 // Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy)
2 // SPDX-License-Identifier: GPL-3.0-or-later
3 
4 #ifndef DP3_STEPS_CLIPPER_H_
5 #define DP3_STEPS_CLIPPER_H_
6 
7 #include "Step.h"
8 
9 #include "common/ParameterSet.h"
10 #include "OnePredict.h"
11 #include "FastPredict.h"
12 #include "PreFlagger.h"
13 #include "Filter.h"
14 #include "ResultStep.h"
15 #include "common/Timer.h"
16 
17 namespace dp3 {
18 namespace steps {
19 
23 
24 class Clipper : public Step {
25  public:
28  Clipper(const common::ParameterSet&, const std::string& prefix);
29 
30  common::Fields getRequiredFields() const override {
31  return kFlagsField | filter_step_->getRequiredFields() |
32  predict_step_->getRequiredFields();
33  }
34 
35  common::Fields getProvidedFields() const override { return kFlagsField; }
36 
38  bool process(std::unique_ptr<base::DPBuffer>) override;
39 
41  void finish() override;
42 
44  void updateInfo(const base::DPInfo&) override;
45 
47  void show(std::ostream&) const override;
48 
50  void showTimings(std::ostream&, double duration) const override;
51 
53  void SetPredict(std::shared_ptr<Step> substep);
54 
55  private:
56  std::string name_;
57  common::NSTimer timer_;
58  size_t counter_;
59  size_t time_step_;
60  size_t frequency_step_;
61  bool flag_all_correlations_;
62  float max_amplitude_;
63  std::shared_ptr<Step> filter_step_;
64  std::shared_ptr<Step> predict_step_;
65  std::shared_ptr<ResultStep> result_step_;
66  std::unique_ptr<dp3::base::DPBuffer> predict_buffer_;
67  base::DPBuffer::FlagsType last_flags_;
68 };
69 
70 } // namespace steps
71 } // namespace dp3
72 
73 #endif
DP3 step class to predict visibilities from a source model.
DP3 step to filter out baselines and channels.
DP3 step class to predict visibilities from a source model.
DP3 step class to flag data on channel, baseline, or time.
Class to hold code for virtual base class for Flaggers in DP3.
xt::xtensor< bool, 3 > FlagsType
Definition: DPBuffer.h:97
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 for clipping bright sources from the data This class is a Step class that predicts visibilit...
Definition: Clipper.h:24
bool process(std::unique_ptr< base::DPBuffer >) override
Process the data. The step forwards the data to its next step.
void updateInfo(const base::DPInfo &) override
Update the general info.
common::Fields getProvidedFields() const override
Definition: Clipper.h:35
void show(std::ostream &) const override
Show the step parameters.
Clipper(const common::ParameterSet &, const std::string &prefix)
common::Fields getRequiredFields() const override
Get the fields required by the current step.
Definition: Clipper.h:30
void finish() override
Finish the processing of this step and subsequent steps.
void SetPredict(std::shared_ptr< Step > substep)
Set the Predict substep and connect it to a ResultStep.
void showTimings(std::ostream &, double duration) const override
Show the timings.
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