FluxCalManager.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2012 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Polarimetry/Pulsar/FluxCalManager.h
10 
11 #ifndef __Calibration_FluxCalManager_H
12 #define __Calibration_FluxCalManager_H
13 
14 #include "Pulsar/SourceDeltaEstimate.h"
15 #include "Pulsar/BackendEstimate.h"
16 #include "Pulsar/SignalPath.h"
17 
18 namespace Calibration
19 {
21 
22  class FluxCalObservation : public Reference::Able
23  {
24  public:
25 
26  void update ();
27 
30 
32 
35 
38  };
39 
40  typedef std::vector< Reference::To<FluxCalObservation> > FluxCalObsVector;
41 
43 
52  class FluxCalManager : public Reference::Able
53  {
54  public:
55 
57  FluxCalManager (SignalPath* composite);
58 
60  void set_backend (const MEAL::Complex2*);
61 
63  void add_observation (Signal::Source type);
64 
66  void integrate (Signal::Source type, const MEAL::Complex2*);
67 
69  void integrate (const Jones< Estimate<double> >& correct,
70  const SourceObservation& data);
71 
72  void submit (CoherencyMeasurementSet&, const SourceObservation&);
73 
75  unsigned get_nstate_on () const;
76 
78  const SourceEstimate* get_source_on (unsigned istate) const;
79 
81  unsigned get_nstate_off () const;
82 
84  const SourceEstimate* get_source_off (unsigned istate) const;
85 
87  void update ();
88 
90  bool is_constrained () const;
91 
93  const std::string& why_not_constrained () const { return not_constrained_reason; }
94 
95  void allow_StokesV_to_vary (bool flag = true);
96  void model_multiple_source_states (bool flag = true);
97  void model_on_minus_off (bool flag = true);
98 
99  protected:
100 
103 
106 
109 
112 
115 
117  FluxCalObsVector on_observations;
118 
120  FluxCalObsVector off_observations;
121 
123 
125 
127  FluxCalObsVector& get_observations (Signal::Source source_type);
128 
130  void set_StokesV_infit (FluxCalObsVector&);
131 
134 
135  private:
136 
137  bool multiple_source_states;
138  bool subtract_off_from_on;
139  bool StokesV_may_vary;
140 
141  mutable std::string not_constrained_reason;
142  };
143 
144 }
145 
146 #endif
FluxCalObsVector on_observations
The set of on-source flux calibrator observations.
Definition: FluxCalManager.h:122
Manages a delta source and the current best estimate of the total.
Definition: SourceDeltaEstimate.h:25
const SourceEstimate * get_source_on(unsigned istate) const
Return the Source estimate for the ith state.
Definition: FluxCalManager.C:306
FluxCalObsVector & get_observations(Signal::Source source_type)
Returns a reference to on_observations or off_observations.
Definition: FluxCalManager.C:115
Reference::To< SourceDeltaEstimate > standard_candle
The difference between on-source and off-source calibrator observations.
Definition: FluxCalManager.h:129
void integrate(Signal::Source type, const MEAL::Complex2 *)
Integrate an estimate of the backend.
Definition: FluxCalManager.C:234
void add_backend(FluxCalObservation *)
Add a new backend to the model.
Definition: FluxCalManager.C:92
void compute(unsigned ireceptor, Estimate< double > &S_cal, Estimate< double > &S_sys)
Compute the fluxes of the reference source and system.
Definition: FluxCalibratorVariableGain.C:66
void integrate(Signal::Source source, unsigned ireceptor, const Estimate< double > &cal_hi, const Estimate< double > &cal_lo)
Integrate an observation of the reference source.
Definition: FluxCalibratorVariableGain.C:30
Definition: Archive.h:26
const MEAL::Complex2 * get_frontend() const
Provide access to the frontend model.
Definition: BackendFeed.h:69
Reference::To< SignalPath > composite
The SignalPath manager into which signal paths are added.
Definition: FluxCalManager.h:119
U get_error() const
Type * release()
Used when gain varies between FluxCal-On and Off observations.
Definition: FluxCalibratorPolicy.h:113
void update()
Update all backend models with current best estimate.
Definition: FluxCalManager.C:328
virtual Complex2 * clone() const
unsigned get_nstate_on() const
Get the number of independent FluxCalOn source states.
Definition: FluxCalManager.C:297
void add_ratio_on(unsigned receptor, Estimate< double > &ratio_on)
Add to the mean hi/lo ratio on source for the specified receptor.
Definition: FluxCalibratorVariableGain.C:46
Manages a single backend and its current best estimate (first guess)
Definition: BackendEstimate.h:54
void add_model(T *model)
unsigned get_nreceptor() const
Get the number of receptors in the calibrator.
Definition: FluxCalibrator.C:765
Instrumental gain, differential gain, and differential phase.
Definition: SingleAxis.h:38
void set_value(const T &t)
A CoherencyMeasurement set and their coordinates.
Definition: CoherencyMeasurementSet.h:26
SourceEstimate * create_SourceEstimate(Signal::Source)
Create a new SourceEstimate of the required type.
Definition: FluxCalManager.C:137
Manages flux calibrator source state and backend transformation.
Definition: FluxCalManager.h:27
void set_backend(const MEAL::Complex2 *)
Set the backend transformation to be cloned for each flux calibrator.
FluxCalManager(SignalPath *composite)
Default constructor.
Definition: FluxCalManager.C:20
void add_observation(Signal::Source type)
Add a new observation.
Definition: FluxCalManager.C:75
unsigned get_nstate_off() const
Get the number of independent FluxCalOff source states.
Definition: FluxCalManager.C:320
void add_source(FluxCalObservation *)
Add a new source to the model.
Definition: FluxCalManager.C:126
Reference::To< SourceEstimate > source
Model of source and its first guess/best estimate.
Definition: FluxCalManager.h:47
const std::string & why_not_constrained() const
Explain why if not constrained.
Definition: FluxCalManager.h:98
FluxCalObsVector off_observations
The set of off-source flux calibrator observations.
Definition: FluxCalManager.h:125
Calibrates flux using standard candles and artificial sources.
Definition: FluxCalibrator.h:29
void add_ratio_off(unsigned receptor, Estimate< double > &ratio_on)
Add to the mean hi/lo ratio off source for the specified receptor.
Definition: FluxCalibratorVariableGain.C:57
A coherency matrix measurement and its estimated error.
Definition: CoherencyMeasurement.h:32
Signal::Source source_type
Source code (FluxCalOn or FluxCalOff)
Definition: FluxCalManager.h:39
Reference::To< MEAL::ProductRule< MEAL::Complex2 > > frontend
The frontend component of the instrument.
Definition: FluxCalManager.h:116
void set_StokesV_infit(FluxCalObsVector &)
Set the fit flag for Stokes V in each source state.
Definition: FluxCalManager.C:221
Physical parameterization of the instrumental response.
Definition: BackendFeed.h:31
const SourceEstimate * get_source_off(unsigned istate) const
Return the Source estimate for the ith state.
Definition: FluxCalManager.C:313
void set_transformation_index(unsigned index)
Set the transformation through which the measurements are made.
Definition: CoherencyMeasurementSet.C:24
Manages a single source and its current best estimate (first guess)
Definition: SourceEstimate.h:30
Reference::To< MEAL::Complex2 > backend
The backend transformation to be cloned for each flux calibrator.
Definition: FluxCalManager.h:113
Reference::To< BackendEstimate > backend
Backend transformation for this observation.
Definition: FluxCalManager.h:44
VariableGain * clone() const
Return a new default constructed copy of self.
Definition: FluxCalibratorVariableGain.C:25
Manages multiple flux calibrator observations.
Definition: FluxCalManager.h:57
Reference::To< MEAL::Coherency > source
Model of Stokes parameters.
Definition: SourceEstimate.h:49
bool is_constrained() const
Return true if at least one complete flux calibrator observation.
Definition: FluxCalManager.C:58

Generated using doxygen 1.8.17