DP3
PredictModel.h
Go to the documentation of this file.
1 // Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
2 // SPDX-License-Identifier: GPL-3.0-or-later
3 
4 #ifndef DP3_BASE_PREDICT_MODEL_H_
5 #define DP3_BASE_PREDICT_MODEL_H_
6 
7 #include <complex>
8 #include <vector>
9 
10 #include <aocommon/xt/utensor.h>
11 
12 namespace dp3::base {
13 
14 class PredictModel {
15  public:
16  explicit PredictModel(size_t n_threads, size_t n_correlations,
17  size_t n_channels, size_t n_baselines,
18  bool include_beam)
19  : model_visibilities_(n_threads) {
20  for (size_t i = 0; i != n_threads; ++i) {
21  model_visibilities_[i].resize({n_baselines, n_channels, n_correlations});
22  }
23 
24  if (include_beam) {
25  patch_model_visibilities_.resize(n_threads);
26  for (size_t i = 0; i != n_threads; ++i) {
27  patch_model_visibilities_[i].resize(
28  {n_baselines, n_channels, n_correlations});
29  }
30  }
31  }
32 
33  aocommon::xt::UTensor<std::complex<double>, 3>& GetModel(
34  size_t thread_index) {
35  return model_visibilities_[thread_index];
36  }
37 
38  aocommon::xt::UTensor<std::complex<double>, 3>& GetPatchModel(
39  size_t thread_index) {
40  return patch_model_visibilities_[thread_index];
41  }
42 
43  private:
44  std::vector<aocommon::xt::UTensor<std::complex<double>, 3>>
45  model_visibilities_;
46  std::vector<aocommon::xt::UTensor<std::complex<double>, 3>>
47  patch_model_visibilities_;
48 };
49 
50 } // namespace dp3::base
51 
52 #endif
Definition: PredictModel.h:14
PredictModel(size_t n_threads, size_t n_correlations, size_t n_channels, size_t n_baselines, bool include_beam)
Definition: PredictModel.h:16
aocommon::xt::UTensor< std::complex< double >, 3 > & GetModel(size_t thread_index)
Definition: PredictModel.h:33
aocommon::xt::UTensor< std::complex< double >, 3 > & GetPatchModel(size_t thread_index)
Definition: PredictModel.h:38
Definition: Apply.h:15