DP3
Upsample.h
Go to the documentation of this file.
1 // Upsample.h: DPPP step class to upsample visibilities
2 // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
3 // SPDX-License-Identifier: GPL-3.0-or-later
4 
8 
9 #ifndef DPPP_DummyStep_H
10 #define DPPP_DummyStep_H
11 
12 #include "InputStep.h"
13 
14 #include "base/DPBuffer.h"
15 
16 #include <utility>
17 
18 namespace dp3 {
19 namespace base {
20 class UVWCalculator;
21 }
22 namespace common {
23 class ParameterSet;
24 }
25 
26 namespace steps {
27 
29 class Upsample : public Step {
30  public:
33  Upsample(const common::ParameterSet&, const std::string& prefix);
34 
36  Upsample(const std::string& name, unsigned int time_step, bool update_uvw);
37 
38  ~Upsample() override;
39 
40  common::Fields getRequiredFields() const override {
41  common::Fields fields = kFlagsField;
42  if (update_uvw_) fields |= kUvwField;
43  return fields;
44  }
45 
46  common::Fields getProvidedFields() const override {
47  return update_uvw_ ? kUvwField : common::Fields();
48  }
49 
53  bool process(std::unique_ptr<base::DPBuffer> buffer) override;
54 
56  void finish() override;
57 
59  void updateInfo(const base::DPInfo&) override;
60 
62  void show(std::ostream&) const override;
63 
64  private:
68  void UpdateTimeCentroidExposureAndUvw(std::unique_ptr<base::DPBuffer>& buffer,
69  double time, double exposure);
70 
71  const std::string name_;
72  const unsigned int time_step_;
73  const bool update_uvw_;
74 
75  std::vector<std::unique_ptr<base::DPBuffer>> prev_buffers_;
76  std::vector<std::unique_ptr<base::DPBuffer>> buffers_;
77  unsigned int first_to_flush_;
78  std::unique_ptr<base::UVWCalculator> uvw_calculator_;
79 
80  common::NSTimer timer_;
81 };
82 
83 } // namespace steps
84 } // namespace dp3
85 
86 #endif
Buffer holding the data of a timeslot/band.
Abstract base class for a Step generating input.
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
Abstract base class for a DP3 step.
Definition: Step.h:52
static constexpr dp3::common::Fields kUvwField
Definition: Step.h:66
static constexpr dp3::common::Fields kFlagsField
Definition: Step.h:62
DPPP step class to Upsample visibilities.
Definition: Upsample.h:29
Upsample(const common::ParameterSet &, const std::string &prefix)
bool process(std::unique_ptr< base::DPBuffer > buffer) override
void updateInfo(const base::DPInfo &) override
Update the general info.
void finish() override
Finish the processing of this step and subsequent steps.
common::Fields getRequiredFields() const override
Get the fields required by the current step.
Definition: Upsample.h:40
void show(std::ostream &) const override
Show the step parameters.
Upsample(const std::string &name, unsigned int time_step, bool update_uvw)
Constructor that gets the settings directly.
common::Fields getProvidedFields() const override
Definition: Upsample.h:46
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53