File: iuwt_deconvolution.h

package info (click to toggle)
wsclean 3.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,296 kB
  • sloc: cpp: 129,246; python: 22,066; sh: 360; ansic: 230; makefile: 185
file content (45 lines) | stat: -rw-r--r-- 1,532 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// SPDX-License-Identifier: LGPL-3.0-only

#ifndef RADLER_ALGORITHMS_IUWT_DECONVOLUTION_H_
#define RADLER_ALGORITHMS_IUWT_DECONVOLUTION_H_

#include <memory>
#include <string>

#include <aocommon/uvector.h>

#include "image_set.h"
#include "algorithms/deconvolution_algorithm.h"
#include "algorithms/iuwt_deconvolution_algorithm.h"

// TODO: consider merging IUWTDeconvolutionAlgorithms into this class.

namespace radler::algorithms {

class IuwtDeconvolution final : public DeconvolutionAlgorithm {
 public:
  DeconvolutionResult ExecuteMajorIteration(
      ImageSet& data_image, ImageSet& model_image,
      const std::vector<aocommon::Image>& psf_images) final {
    IuwtDeconvolutionAlgorithm algorithm(
        data_image.Width(), data_image.Height(), MinorLoopGain(),
        MajorLoopGain(), CleanBorderRatio(), AllowNegativeComponents(),
        CleanMask(), Threshold());
    size_t iteration_number = IterationNumber();
    DeconvolutionResult result;
    result.final_peak_value = algorithm.PerformMajorIteration(
        iteration_number, MaxIterations(), model_image, data_image, psf_images,
        result.another_iteration_required);
    SetIterationNumber(iteration_number);
    if (IterationNumber() >= MaxIterations()) {
      result.another_iteration_required = false;
    }
    return result;
  }

  std::unique_ptr<DeconvolutionAlgorithm> Clone() const final {
    return std::make_unique<IuwtDeconvolution>(*this);
  }
};
}  // namespace radler::algorithms
#endif  // RADLER_ALGORITHMS_IUWT_DECONVOLUTION_H_