File: unavailablegridder.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 (78 lines) | stat: -rw-r--r-- 2,234 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef NOT_IMPLEMENTED_GRIDDER_H
#define NOT_IMPLEMENTED_GRIDDER_H

#include "msgridder.h"
#include "../structures/resources.h"

#include <aocommon/image.h>
#include <aocommon/fits/fitswriter.h>

#include <stdexcept>
#include <string>

namespace wsclean {

class UnavailableGridder final : public MsGridder {
 public:
  UnavailableGridder(const class Settings& settings, const Resources& resources,
                     MsProviderCollection& ms_provider_collection)
      : MsGridder(settings, ms_provider_collection) {
    doThrow();
  }

  ~UnavailableGridder() final { doThrow(); }

  void StartInversion() final { doThrow(); }
  size_t GridMeasurementSet(const MsProviderCollection::MsData& ms_data) final {
    doThrow();
    return 0;
  }
  void FinishInversion() final { doThrow(); }

  void StartPredict(std::vector<aocommon::Image>&& images) final { doThrow(); }
  size_t PredictMeasurementSet(
      const MsProviderCollection::MsData& /*ms_data*/) final {
    doThrow();
    return 0;
  }
  void FinishPredict() final { doThrow(); }

  std::vector<aocommon::Image> ResultImages() final {
    doThrow();
    return {};
  }

  static void SavePBCorrectedImages(aocommon::FitsWriter& /*writer*/,
                                    class ImageFilename& /*filename*/,
                                    const std::string& /*filenameKind*/,
                                    const Settings&) {}

  static void SaveBeamImage(const struct ImagingTableEntry& /*entry*/,
                            class ImageFilename& /*filename*/, const Settings&,
                            double, double, double, double,
                            const AverageBeam&) {}

  void SetAverageBeam(std::unique_ptr<AverageBeam>) { doThrow(); }

  std::unique_ptr<AverageBeam> ReleaseAverageBeam() {
    doThrow();
    return {};
  }

 private:
  size_t GetSuggestedWGridSize() const final {
    doThrow();
    return 0;
  }

  void doThrow() const {
    throw std::runtime_error(
        "This gridder is not available, because WSClean was not compiled to "
        "have this gridder. Use a different gridder or recompile WSClean and "
        "make sure the necessary prerequisites are satisfied.");
  }
};

}  // namespace wsclean

#endif