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
18namespace Calibration {
19
21
23
26
28 {
29
30 public:
31
34
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
53 // ///////////////////////////////////////////////////////////////////
54 //
55 // Remove data from the model
56 //
57 // ///////////////////////////////////////////////////////////////////
58
60 void delete_data ();
61
63 void erase_input (unsigned index) override;
64
66 void erase_transformation (unsigned index) override;
67
68 // ///////////////////////////////////////////////////////////////////
69 //
70 // Report on the model
71 //
72 // ///////////////////////////////////////////////////////////////////
73
74 class Report;
75
78
81
82 // ///////////////////////////////////////////////////////////////////
83 //
84 // Fit the model
85 //
86 // ///////////////////////////////////////////////////////////////////
87
88 class Solver;
89
91 static Solver* new_default_Solver ();
92
94 void set_solver (Solver*);
95
98 const Solver* get_solver () const;
99
101 void solve ();
102
104 bool get_solved () const;
105
107 void copy_fit (const ReceptionModel*);
108
109 // ///////////////////////////////////////////////////////////////////
110 //
111 // Model implementation
112 //
113 // ///////////////////////////////////////////////////////////////////
114
116 std::string get_name () const;
117
118 protected:
119
121 void range_check (unsigned idata, const char* method) const;
122
125
127 std::vector< Reference::To<Report> > prefit_reports;
128
130 std::vector< Reference::To<Report> > postfit_reports;
131
132 private:
133
135 friend class Solver;
136
138 std::vector<CoherencyMeasurementSet> data;
139
140 };
141
142
143}
144
145#endif
146
A CoherencyMeasurement set and their coordinates.
Definition CoherencyMeasurementSet.h:22
MeasurementEquation()
Default constructor.
Definition MeasurementEquation.C:19
Base class of objects that report on properties of the measurement equation.
Definition ReceptionModelReport.h:20
Solve the measurement equation by non-linear least squares minimization.
Definition ReceptionModelSolver.h:22
void add_postfit_report(Report *)
Add a report to be executed after solving the measurement equation.
Definition ReceptionModel.C:76
const CoherencyMeasurementSet & get_data(unsigned idata) const
Get the specified CoherencyMeasurementSet.
Definition ReceptionModel.C:168
void add_prefit_report(Report *)
Add a report to be executed before solving the measurement equation.
Definition ReceptionModel.C:69
std::vector< Reference::To< Report > > prefit_reports
Reports to run before solving.
Definition ReceptionModel.h:127
std::vector< Reference::To< Report > > postfit_reports
Reports to run after solving.
Definition ReceptionModel.h:130
void erase_input(unsigned index) override
Remove the specified input from the model and update all measurements.
Definition ReceptionModel.C:182
void erase_transformation(unsigned index) override
Remove the specified transformation from the model and update all measurements.
Definition ReceptionModel.C:197
ReceptionModel()
null constructor
Definition ReceptionModel.C:20
Solver * get_solver()
Get the algorithm used to solve the measurement equation.
Definition ReceptionModel.C:56
void solve()
Solve the measurement equation using the current algorithm.
Definition ReceptionModel.C:83
void set_solver(Solver *)
Set the algorithm used to solve the measurement equation.
Definition ReceptionModel.C:44
std::string get_name() const
Return the name of the class.
Definition ReceptionModel.C:38
bool get_solved() const
Return true when solved.
Definition ReceptionModel.C:97
static Solver * new_default_Solver()
Returns a new instance of the default Solver algorithm.
Definition ReceptionModel.C:27
~ReceptionModel()
destructor
Definition ReceptionModel.C:32
void copy_fit(const ReceptionModel *)
Copy the fitted parameters from another model.
Definition ReceptionModel.C:102
virtual void add_data(CoherencyMeasurementSet &data)
Checks that each CoherencyMeasurement has a valid source_index.
Definition ReceptionModel.C:121
void delete_data()
Delete all data.
Definition ReceptionModel.C:155
void range_check(unsigned idata, const char *method) const
Ensure that idata <= get_ndata()
Definition ReceptionModel.C:174
unsigned get_ndata() const
Get the number of CoherencyMeasurementSet.
Definition ReceptionModel.C:161
Reference::To< Solver > solver
The algorithm used to solve the measurement equation.
Definition ReceptionModel.h:124

Generated using doxygen 1.14.0