ReceptionModel.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Polarimetry/Pulsar/ReceptionModel.h
10 
11 #ifndef __ReceptionModel_H
12 #define __ReceptionModel_H
13 
14 #include "Pulsar/MeasurementEquation.h"
15 #include "MEAL/SumRule.h"
16 #include "Estimate.h"
17 
18 namespace Calibration {
19 
20  class CoherencyMeasurementSet;
21 
23 
27  class ReceptionModel : public MeasurementEquation
28  {
29 
30  public:
31 
33  ReceptionModel ();
34 
36  ~ReceptionModel ();
37 
38  // ///////////////////////////////////////////////////////////////////
39  //
40  // Add data to the model
41  //
42  // ///////////////////////////////////////////////////////////////////
43 
45  virtual void add_data (CoherencyMeasurementSet& data);
46 
48  unsigned get_ndata () const;
49 
51  const CoherencyMeasurementSet& get_data (unsigned idata) const;
52 
54  void delete_data ();
55 
56  // ///////////////////////////////////////////////////////////////////
57  //
58  // Report on the model
59  //
60  // ///////////////////////////////////////////////////////////////////
61 
62  class Report;
63 
65  void add_prefit_report (Report*);
66 
68  void add_postfit_report (Report*);
69 
70  // ///////////////////////////////////////////////////////////////////
71  //
72  // Fit the model
73  //
74  // ///////////////////////////////////////////////////////////////////
75 
76  class Solver;
77 
79  static Solver* new_default_Solver ();
80 
82  void set_solver (Solver*);
83 
85  Solver* get_solver ();
86  const Solver* get_solver () const;
87 
89  void solve ();
90 
92  bool get_solved () const;
93 
95  void copy_fit (const ReceptionModel*);
96 
97  // ///////////////////////////////////////////////////////////////////
98  //
99  // Model implementation
100  //
101  // ///////////////////////////////////////////////////////////////////
102 
104  std::string get_name () const;
105 
106  protected:
107 
109  void range_check (unsigned idata, const char* method) const;
110 
113 
115  std::vector< Reference::To<Report> > prefit_reports;
116 
118  std::vector< Reference::To<Report> > postfit_reports;
119 
120  private:
121 
123  friend class Solver;
124 
126  std::vector<CoherencyMeasurementSet> data;
127 
128  };
129 
130 
131 }
132 
133 #endif
134 
Solver * get_solver()
Get the algorithm used to solve the measurement equation.
Definition: ReceptionModel.C:53
void set_equation(ReceptionModel *)
Set the measurement equation to be solved.
Definition: ReceptionModelSolver.C:269
void copy_fit(const ReceptionModel *)
Copy the fitted parameters from another model.
Definition: ReceptionModel.C:97
void add_postfit_report(Report *)
Add a report to be executed after solving the measurement equation.
Definition: ReceptionModel.C:73
unsigned get_nparam() const
Solve the measurement equation by non-linear least squares minimization.
Definition: ReceptionModelReport.h:24
void add_prefit_report(Report *)
Add a report to be executed before solving the measurement equation.
Definition: ReceptionModel.C:66
Models a set of transformations and source polarizations.
Definition: ReceptionModel.h:32
static Solver * new_default_Solver()
Returns a new instance of the default Solver algorithm.
Definition: ReceptionModel.C:25
Solve the measurement equation by non-linear least squares minimization.
Definition: ReceptionModelSolver.h:26
std::vector< Reference::To< Report > > postfit_reports
Reports to run after solving.
Definition: ReceptionModel.h:123
ReceptionModel()
null constructor
Definition: ReceptionModel.C:19
friend class Solver
Provide Solver class with acces to data.
Definition: ReceptionModel.h:128
A CoherencyMeasurement set and their coordinates.
Definition: CoherencyMeasurementSet.h:26
double get_param(unsigned index) const
virtual void add_data(CoherencyMeasurementSet &data)
Checks that each CoherencyMeasurement has a valid source_index.
Definition: ReceptionModel.C:116
std::vector< Reference::To< Report > > prefit_reports
Reports to run before solving.
Definition: ReceptionModel.h:120
unsigned get_ndata() const
Get the number of CoherencyMeasurementSet.
Definition: ReceptionModel.C:156
std::string get_name() const
Return the name of the class.
Definition: ReceptionModel.C:38
void delete_data()
Delete all data.
Definition: ReceptionModel.C:150
Reference::To< Solver > solver
The algorithm used to solve the measurement equation.
Definition: ReceptionModel.h:117
bool get_infit(unsigned index) const
unsigned get_transformation_index() const
Get the transformation through which the measurements are made.
Definition: CoherencyMeasurementSet.C:30
bool get_solved() const
Return true when solved.
Definition: ReceptionModel.C:92
void range_check(unsigned idata, const char *method) const
Ensure that idata <= get_ndata()
Definition: ReceptionModel.C:169
void set_model(ReceptionModel *_model)
Set the measurement equation on which to report.
Definition: ReceptionModelReport.h:44
const CoherencyMeasurementSet & get_data(unsigned idata) const
Get the specified CoherencyMeasurementSet.
Definition: ReceptionModel.C:163
Solve the measurement equation by non-linear least squares minimization.
Definition: ReceptionModelSolveMEAL.h:24
void solve()
Solve the measurement equation using the current algorithm.
Definition: ReceptionModel.C:80
~ReceptionModel()
destructor
Definition: ReceptionModel.C:30
void set_solver(Solver *)
Set the algorithm used to solve the measurement equation.
Definition: ReceptionModel.C:44

Generated using doxygen 1.8.17