Manticore  Version 1.5.3
Physics of Molecular Clouds
Detector.h
Go to the documentation of this file.
1 #ifndef DETECTOR_H
2 #define DETECTOR_H
3 
4 #include <gsl/gsl_spline.h>
5 
6 #include "mutils/util.h"
7 
8 namespace manticore {
9 
10 // Forward reference.
11 class Graybody;
12 
13 
51 class Detector {
52 public:
55  Detector(bool extend = true) noexcept : extend_(extend) { }
56 
58  virtual ~Detector() {
59  if (spline_) { gsl_spline_free(spline_); }
60  }
61 
63  virtual std::string name() const = 0;
64 
66  virtual void init();
67 
69  virtual double freqBand() const noexcept { return center_; }
70 
75  virtual double freqWidth() const noexcept { return width_; }
76 
78  virtual std::pair<double, double> freqRange() const noexcept
79  { return freqRange_; }
80 
82  virtual std::pair<double, double> sysError() const noexcept
83  { return sysError_; }
84 
86  bool isExtended() const noexcept { return extend_; }
87 
91  virtual double response(double nu, gsl_interp_accel *acc = nullptr) const;
92 
97  virtual double ccf(const Graybody &gray, double T, double Sigma = 1.0) const;
98 
99 protected:
102 
104  void calcWidth();
105 
108 
111 
114 
116  bool extend_;
117 
118  double center_ = 0.0,
119  width_ = 0.0;
120 
122  gsl_spline *spline_ = nullptr;
123 };
124 
125 } // namespace manticore
126 
127 #endif // DETECTOR_H
std::pair< double, double > freqRange_
Response edge frequencies (Hz).
Definition: Detector.h:107
double center_
Effective band center (Hz).
Definition: Detector.h:118
virtual void init()
Initializes detector characteristics.
Definition: Detector.cc:33
virtual std::pair< double, double > sysError() const noexcept
Systematic calibration error (correlated, uncorrelated) between bands.
Definition: Detector.h:82
virtual double freqBand() const noexcept
Reference band center frequency (Hz).
Definition: Detector.h:69
virtual double freqWidth() const noexcept
Effective flux-conversion bandwidth (Hz).
Definition: Detector.h:75
Package namespace.
Definition: Detector.cc:15
virtual std::string name() const =0
Official detector name (INSTRUMENT-BAND).
virtual double ccf(const Graybody &gray, double T, double Sigma=1.0) const
Color correction factor.
Definition: Detector.cc:90
The MathUtils miscellaneous utilities library.
virtual std::pair< double, double > freqRange() const noexcept
Frequency range containing significant response.
Definition: Detector.h:78
virtual double response(double nu, gsl_interp_accel *acc=nullptr) const
Absolute spectral response function.
Definition: Detector.cc:57
Detector base class.
Definition: Detector.h:51
bool extend_
Default to extended (else point) source observation.
Definition: Detector.h:116
Graybody emission model.
Definition: Graybody.h:40
virtual ~Detector()
Destructor.
Definition: Detector.h:58
double width_
Effective (flux) bandwidth (Hz).
Definition: Detector.h:119
gsl_spline * spline_
Response interpolator.
Definition: Detector.h:122
bool isExtended() const noexcept
Whether extended source detection is enabled.
Definition: Detector.h:86
std::pair< double, double > sysError_
Relative systematic errors (global/instrument, detector/band).
Definition: Detector.h:110
Detector(bool extend=true) noexcept
Default constructor.
Definition: Detector.h:55
tableType resp_
Spectral response table.
Definition: Detector.h:113
void calcWidth()
Calculates effective bandwidth using standard prescription.
Definition: Detector.cc:75