ReceptionCalibrator.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2003 - 2012 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Polarimetry/Pulsar/ReceptionCalibrator.h
10
11#ifndef __Pulsar_ReceptionCalibrator_H
12#define __Pulsar_ReceptionCalibrator_H
13
14#include "Pulsar/SystemCalibrator.h"
15#include "Pulsar/ReflectStokes.h"
16
17#include "Pulsar/FluxCalManager.h"
18#include "Pulsar/StandardData.h"
19
20#include "MEAL/VectorRule.h"
21
22namespace Pulsar
23{
24
25 class Archive;
26 class Integration;
28 class FluxCalibrator;
29
31
38 {
39
40 public:
41
42 friend class ReceptionCalibratorPlotter;
43 friend class SourceInfo;
44
47
50
53
56
59
62
65
68
71
74
77
80
83
85 ReflectStokes reflections;
86
88 void add_state (unsigned pulse_phase_bin);
89
91 unsigned get_nstate_pulsar () const;
92
94 Calibrator::Info* new_info_pulsar (unsigned istate) const;
95
97 void set_standard_data (const Archive* data);
98
100 const PhaseWeight* get_baseline () const;
101
103 const PhaseWeight* get_onpulse () const;
104
106 bool has_fluxcal () const;
107
109 const Calibration::FluxCalManager* get_fluxcal (unsigned ichan) const;
110
112 void set_normalize_by_invariant (bool set = true);
113
115 double get_invariant (Integration* subint, unsigned ichan) override;
116
117 protected:
118
121
124
127
128 std::vector< Reference::To<Calibration::FluxCalManager> > fluxcal;
129
130 typedef Reference::To<Calibration::SourceEstimate> SourceEstimate;
131
133 std::vector< std::vector< SourceEstimate > > pulsar_estimate;
134 std::vector< unsigned > phase_bins;
135
137 std::vector<MJD> calibrator_epochs;
138
139 // counts the number of times that add_data failed
140 unsigned add_data_fail;
141
142 // counts the number of times that add_data is called
143 unsigned add_data_call;
144
146 unsigned nthread;
147
149 void init_model (unsigned ichan);
150
152 void initial_observation (const Archive* data);
153
154 void valid_mask (const std::vector<Calibration::SourceEstimate>&);
155
157
162 void add_data (std::vector<Calibration::CoherencyMeasurement>& bins,
164 const MJD& epoch, unsigned ichan);
165
168 std::vector<bool> fluxcal_observation_added;
169
171 const Calibration::SourceObservation&);
172
173 void integrate_calibrator_data (const Calibration::SourceObservation&);
174
175 void integrate_calibrator_solution (const Calibration::SourceObservation&);
176
179
181 bool match (const Archive*, bool throw_exception = true);
182
184 const Integration*, unsigned ichan);
185
186 Calibration::SourceEstimate* get_estimate (unsigned index, unsigned ichan);
187
189
192 const MJD& epoch, unsigned ichan);
193
195
196 void solve_prepare ();
197
199 void export_prepare () const;
200
202 void setup_calibrators ();
203 void setup_poln_calibrator (Calibration::SourceEstimate*);
204 void setup_flux_calibrator (Calibration::FluxCalManager*);
205
208 };
209
210}
211
212#endif
A CoherencyMeasurement set and their coordinates.
Definition CoherencyMeasurementSet.h:22
A coherency matrix measurement and its estimated error.
Definition CoherencyMeasurement.h:27
Manages multiple flux calibrator observations.
Definition FluxCalManager.h:53
Manages a single source and its current best estimate (first guess)
Definition SourceEstimate.h:26
The primary interface to pulsar observational data.
Definition Archive.h:46
Definition Calibrator.h:151
Definition CalibratorType.h:26
Calibrates flux using standard candles and artificial sources.
Definition FluxCalibrator.h:24
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
Stores a weight for each Profile phase bin.
Definition PhaseWeight.h:24
Index subint
The sub-integration from which to construct a solution.
Definition PolnCalibrator.h:202
MEAL::VectorRule< MEAL::Complex2 > * unique
The unique transformation for each observation.
Definition ReceptionCalibrator.h:123
void valid_mask(const std::vector< Calibration::SourceEstimate > &)
Definition ReceptionCalibrator.C:824
bool match(const Archive *, bool throw_exception=true)
Ensure that the pulsar observation can be added to the data set.
Definition ReceptionCalibrator.C:338
Calibrator::Info * new_info_pulsar(unsigned istate) const
Retern a new plot information interface for the specified state.
Definition ReceptionCalibrator.C:836
const PhaseWeight * get_baseline() const
Get the baseline mask.
Definition ReceptionCalibrator.C:134
const PhaseWeight * get_onpulse() const
Get the on-pulse mask.
Definition ReceptionCalibrator.C:143
void set_standard_data(const Archive *data)
Set the observation that defines the baseline and on-pulse phase bins.
Definition ReceptionCalibrator.C:80
void solve_prepare()
Prepare the measurement equations for fitting.
Definition ReceptionCalibrator.C:715
bool output_report
Produce reports of reduced chisq for each state in each channel.
Definition ReceptionCalibrator.h:76
~ReceptionCalibrator()
Descructor.
Definition ReceptionCalibrator.C:76
void add_pulsar(Calibration::CoherencyMeasurementSet &, const Integration *, unsigned ichan)
Add pulsar data constraints to coherency measurement set.
Definition ReceptionCalibrator.C:372
bool equal_ellipticities
Assume that the receptor ellipticities are equal.
Definition ReceptionCalibrator.h:64
Reference::To< Calibration::StandardData > standard_data
Standard data interface.
Definition ReceptionCalibrator.h:120
bool check_pointing
Print an error message if Pointing parameters are not as expected.
Definition ReceptionCalibrator.h:73
bool degenerate_V_boost
The boost along Stokes V is intrinsically degenerate.
Definition ReceptionCalibrator.h:52
bool measure_cal_V
Allow the CAL Stokes V to vary (applies only if FluxCal observed)
Definition ReceptionCalibrator.h:55
void export_prepare() const
Prepare to export the solution.
Definition ReceptionCalibrator.C:710
ReceptionCalibrator(Calibrator::Type *)
Construct with optional first pulsar archive.
Definition ReceptionCalibrator.C:49
const Calibration::FluxCalManager * get_fluxcal(unsigned ichan) const
Return the flux calibration manager for the specified frequency channel.
Definition ReceptionCalibrator.C:633
void setup_calibrators()
Set fit flags and initial values of the calibrator Stokes parameters.
Definition ReceptionCalibrator.C:551
bool degenerate_V_rotation
The rotation about Stokes V is instrinsically degenerate.
Definition ReceptionCalibrator.h:58
void prepare_calibrator_estimate(Signal::Source)
Prepare the calibrator estimate.
Definition ReceptionCalibrator.C:504
void init_model(unsigned ichan)
Initialize the SignalPath of the specified channel.
Definition ReceptionCalibrator.C:253
unsigned nthread
The number of channels that may be simultaneously solved.
Definition ReceptionCalibrator.h:146
bool independent_gains
Allow the gain to vary independently from observation to observation.
Definition ReceptionCalibrator.h:70
void add_state(unsigned pulse_phase_bin)
Add the specified pulse phase bin to the set of state constraints.
Definition ReceptionCalibrator.C:307
void submit_calibrator_data()
Handle any integrated flux calibrator data.
Definition ReceptionCalibrator.C:270
void add_data(std::vector< Calibration::CoherencyMeasurement > &bins, Calibration::SourceEstimate *estimate, const MJD &epoch, unsigned ichan)
Add Integration data to the CoherencyMeasurement vector.
Definition ReceptionCalibrator.C:402
void integrate_pulsar_data(const Calibration::CoherencyMeasurementSet &)
add pulsar data to mean estimate used as initial guess
Definition ReceptionCalibrator.C:447
double get_invariant(Integration *subint, unsigned ichan) override
Return the invariant for the specified integration and frequency channel.
Definition ReceptionCalibrator.C:361
bool multiple_flux_calibrators
Each flux calibrator observation may have unique values of I, Q & U.
Definition ReceptionCalibrator.h:79
void initial_observation(const Archive *data)
Initialization performed using the first observation added.
Definition ReceptionCalibrator.C:170
ReflectStokes reflections
Reflections performed on the calibrator data immediately after loading.
Definition ReceptionCalibrator.h:85
bool model_fluxcal_on_minus_off
Model the difference between FluxCalOn and FluxCalOff observations.
Definition ReceptionCalibrator.h:82
bool physical_coherency
Enforce that Stokes I > |p|, where p=(Q,U,V)
Definition ReceptionCalibrator.h:67
unsigned get_nstate_pulsar() const
Get the number of pulsar phase bin input polarization states.
Definition ReceptionCalibrator.C:331
bool measure_cal_Q
Allow the CAL Stokes Q to vary.
Definition ReceptionCalibrator.h:61
std::vector< std::vector< SourceEstimate > > pulsar_estimate
Uncalibrated estimate of pulsar polarization as a function of phase.
Definition ReceptionCalibrator.h:133
std::vector< MJD > calibrator_epochs
The epochs of all loaded calibrators.
Definition ReceptionCalibrator.h:137
MEAL::Axis< unsigned > unique_axis
The unique transformation "axis".
Definition ReceptionCalibrator.h:126
void set_normalize_by_invariant(bool set=true)
Normalize each Stokes vector by the mean on-pulse invariant.
Definition ReceptionCalibrator.C:151
void ensure_consistent_onpulse()
Ensure that selected phase bins are represented in on-pulse mask.
Definition ReceptionCalibrator.C:105
bool has_fluxcal() const
Return true if any flux calibrator observations are available.
Definition ReceptionCalibrator.C:627
Calibrators derived from reference source observations.
Definition ReferenceCalibrator.h:27
SystemCalibrator(Archive *archive=0)
Construct with optional processed calibrator Archive.
Definition SystemCalibrator.C:61
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0