12 #ifndef __Pulsar_BackendEstimate_H
13 #define __Pulsar_BackendEstimate_H
15 #include "MEAL/Complex2.h"
16 #include "MEAL/Mean.h"
28 setMJD () { set = false; }
30 operator const MJD& () const { return mjd; }
32 const setMJD& operator = ( const MJD& _mjd)
33 { mjd = _mjd; set = true; return * this; }
35 friend bool operator < ( const setMJD& setmjd, const MJD& mjd)
36 { return !setmjd.set || setmjd.mjd < mjd; }
38 friend bool operator > ( const setMJD& setmjd, const MJD& mjd)
39 { return !setmjd.set || setmjd.mjd > mjd; }
41 friend bool operator < ( const MJD& mjd, const setMJD& setmjd)
42 { return !setmjd.set || mjd < setmjd.mjd; }
44 friend bool operator > ( const MJD& mjd, const setMJD& setmjd)
45 { return !setmjd.set || mjd > setmjd.mjd; }
47 friend ostream& operator << (ostream& os, const setMJD& setmjd)
48 { if (!setmjd.set) os << "unset"; else os << setmjd.mjd; return os; }
93 virtual void update ();
98 void set_start_time ( const MJD& epoch) { start_time = epoch; }
99 const MJD& get_start_time () const { return start_time; }
101 void set_end_time ( const MJD& epoch) { end_time = epoch; }
102 const MJD& get_end_time () const { return end_time; }
105 bool spans ( const MJD& epoch);
108 void add_observation_epoch ( const MJD& epoch);
110 void add_weight ( float amount) { weight += amount; }
111 float get_weight () const { return weight; }
116 #include "MEAL/ChainRule.h"
117 #include "MEAL/ProductRule.h"
121 template< class Type, class Base>
122 Type* extract (Base* base)
124 Type* type = dynamic_cast<Type* >( base );
131 return extract<Type> ( chain->get_model() );
137 for ( unsigned imodel=0; imodel<product->get_nmodel(); imodel++)
139 Type* type = extract<Type> ( product->get_model(imodel) );
149 void print (std::ostream& os, Base* base, const std::string& indent = "")
151 os << indent << ( void*) base << " " << base->get_name() << endl;
157 Base* model = chain->get_model();
158 print (os, model, indent + " model ");
160 for ( unsigned i=0; i < model->get_nparam(); i++)
161 if (chain->has_constraint (i))
162 print (os, chain->get_constraint(i),
163 indent + " by[" + tostring(i) + "] ");
172 for ( unsigned imodel=0; imodel<product->get_nmodel(); imodel++)
173 print (os, product->get_model(imodel), indent + " ");
178 for ( unsigned i=0; i<base->get_nparam(); i++)
179 os << indent << " " << i << " " << base->get_param (i)
180 << " " << base->get_infit(i) << endl;
unsigned path_index The index of the SignalPath in which this backend is a component. Definition: BackendEstimate.h:84
Reference::To< MEAL::Complex2 > backend The backend component. Definition: BackendEstimate.h:60
Manages a single backend and its current best estimate (first guess) Definition: BackendEstimate.h:54
setMJD start_time The start of the period spanned by this backend solution. Definition: BackendEstimate.h:66
unsigned get_path_index() const Return the path index. Definition: BackendEstimate.h:96
Instrumental gain, differential gain, and differential phase. Definition: SingleAxis.h:38
MJD min_time The mimimum observation time. Definition: BackendEstimate.h:72
void integrate(const MEAL::Complex2 *xform) Integrate a calibrator solution. Definition: BackendEstimate.C:72
Reference::To< MEAL::Mean< MEAL::Complex2 > > mean The mean of the backend component. Definition: BackendEstimate.h:63
virtual void set_response(MEAL::Complex2 *xform) Set the response that contains the backend. Definition: BackendEstimate.C:20
virtual std::string get_name() const=0
bool verbose Definition: timer++.C:25
bool spans(const MJD &epoch) Return true if this estimate spans the epoch. Definition: BackendEstimate.C:149
MJD max_time The maximum observation time. Definition: BackendEstimate.h:75
virtual void update() Update the transformation with the current estimate, if possible. Definition: BackendEstimate.C:133
void add_observation_epoch(const MJD &epoch) update min_time and max_time Definition: BackendEstimate.C:160
const std::string get_message() const
A weighted mean of SingleAxis parameter estimates. Definition: MeanSingleAxis.h:27
setMJD end_time The end of the period spanned by this solution. Definition: BackendEstimate.h:69
A weighted mean of MEAL::Polar parameter estimates. Definition: MeanPolar.h:25
Generated using doxygen 1.8.17
|