DP3
SolutionResampler.h
Go to the documentation of this file.
1 // Copyright (C) 2021 ASTRON (Netherlands Institute for Radio Astronomy)
2 // SPDX-License-Identifier: GPL-3.0-or-later
3 
4 #ifndef DP3_DDECAL_SOLUTIONRESAMPLER_H_
5 #define DP3_DDECAL_SOLUTIONRESAMPLER_H_
6 
7 #include <complex>
8 #include <vector>
9 
11 
12 namespace dp3 {
13 namespace ddecal {
14 
20  public:
25  SolutionResampler(const std::vector<size_t>& n_solutions_per_direction,
26  size_t n_antennas, size_t solution_interval);
27  ~SolutionResampler() = default;
28 
38  std::vector<std::vector<std::vector<std::complex<double>>>> Upsample(
39  const std::vector<std::vector<std::vector<std::complex<double>>>>&
40  solutions,
41  size_t n_pol) const;
42 
43  std::vector<std::vector<std::vector<ConstraintResult>>> Upsample(
44  const std::vector<std::vector<std::vector<ConstraintResult>>>& solutions)
45  const;
46 
54  size_t GetNrSubSteps() const { return n_substeps_; }
55 
60  std::pair<size_t, size_t> MapResampledToOriginal(size_t time_index,
61  size_t antenna_index,
62  size_t direction_index,
63  size_t pol_index,
64  size_t n_pol) const;
65 
66  private:
67  const std::vector<size_t> n_solutions_per_direction_;
68  const size_t n_sub_solutions_;
69  const size_t n_directions_;
70 
71  const size_t n_antennas_;
72  const size_t solution_interval_;
73  size_t n_substeps_;
74 };
75 
76 } // namespace ddecal
77 } // namespace dp3
78 
79 #endif
Class for resampling the solution into a square multi-dimensional array.
Definition: SolutionResampler.h:19
std::vector< std::vector< std::vector< std::complex< double > > > > Upsample(const std::vector< std::vector< std::vector< std::complex< double >>>> &solutions, size_t n_pol) const
Compute the upsampled solutions for dd interval solutions.
std::pair< size_t, size_t > MapResampledToOriginal(size_t time_index, size_t antenna_index, size_t direction_index, size_t pol_index, size_t n_pol) const
Map index in upsampled solutions vector to the matching index in the original solution vector.
SolutionResampler(const std::vector< size_t > &n_solutions_per_direction, size_t n_antennas, size_t solution_interval)
std::vector< std::vector< std::vector< ConstraintResult > > > Upsample(const std::vector< std::vector< std::vector< ConstraintResult >>> &solutions) const
size_t GetNrSubSteps() const
Get the number of substeps per solution interval.
Definition: SolutionResampler.h:54
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53