Simulation/Pulsar/SimPolnTiming.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2005 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/SimPolnTiming.h
10 
11 #ifndef __Pulsar_SimPolnTiming_h
12 #define __Pulsar_SimPolnTiming_h
13 
14 #include "Pulsar/SyntheticPolnProfile.h"
15 #include "Pulsar/PolnProfileFit.h"
16 #include "MEAL/RotatingVectorModel.h"
17 #include "MEAL/Gaussian.h"
18 
19 #include <iostream>
20 
21 namespace Pulsar {
22 
23  class Archive;
24 
25  class Range {
26  public:
28  Range (unsigned steps, double min, double max);
29 
30  unsigned steps;
31  double min, max;
32  unsigned start, stop;
33 
35  double get_value (unsigned current);
36 
38  void parse (const std::string& txt);
39  };
40 
41  std::ostream& operator<< (std::ostream& ostr, const Range& r);
42 
44  class SimPolnTiming {
45 
46  public:
47 
49  SimPolnTiming ();
50 
52  ~SimPolnTiming ();
53 
55  SyntheticPolnProfile generate;
56 
58  PolnProfileFit fit;
59 
62 
65 
67  unsigned nbin;
68 
70  void set_centre (double);
71 
73  float standard_noise;
74 
76  float rvm_beta;
77 
79  void set_standard (Archive*);
80 
82  unsigned iterations;
83 
85  float measurement_noise;
86 
88  float offset;
89 
91  bool vary_line_of_sight;
92 
94  Range slope;
95  double poln_slope;
96 
98  Range width;
99  double pulse_width;
100 
102  Range dgain;
103  double diff_gain;
104 
106  Range parallactic;
107  double parallactic_angle;
108 
110  Range boost_vector;
111  double B_orientation;
112  double B_ellipticity;
113  double beta;
114 
116  void run_simulation ();
117 
119  std::string title;
120 
122  bool as_Estimate;
123 
125  std::ostream* output;
126 
127  bool logarithmic;
128  void extrapolate_benefit (unsigned steps);
129  void susceptibility ();
130 
132  void boost_around ();
133 
134  protected:
135 
136  class Result {
137  public:
138  Estimate<double> I_est_mean;
139  Estimate<double> S_est_mean;
140  Estimate<double> I_mean;
141  Estimate<double> S_mean;
142  Estimate<double> I_err;
143  Estimate<double> S_err;
144  };
145 
147  void one_loop (unsigned level);
148 
150  Result one_step ();
151 
154 
155  };
156 
157 }
158 
159 #endif
bool as_Estimate
Output values using Estimate operator <<.
Definition: General/Pulsar/SimPolnTiming.h:127
void extrapolate_benefit(unsigned steps)
Account for noise in the standard profile.
Definition: SimPolnTiming.C:410
Range boost_vector
Number of steps when varying the parallactic angle.
Definition: General/Pulsar/SimPolnTiming.h:115
Range width
Number of steps when varying the Gaussian width.
Definition: General/Pulsar/SimPolnTiming.h:103
Range parallactic
Number of steps when varying the parallactic angle.
Definition: General/Pulsar/SimPolnTiming.h:111
float rvm_beta
Difference between magnetic axis and line of sight.
Definition: General/Pulsar/SimPolnTiming.h:81
std::ostream * output
Output stream.
Definition: General/Pulsar/SimPolnTiming.h:130
float standard_noise
Relative noise in standard profile.
Definition: General/Pulsar/SimPolnTiming.h:78
float offset
Phase offset of simulated observations.
Definition: General/Pulsar/SimPolnTiming.h:93
unsigned iterations
Number of simulated observations for each step in simulation.
Definition: General/Pulsar/SimPolnTiming.h:87
void set_centre(double)
Set the phase of the standard profile centre.
Definition: SimPolnTiming.C:151
void set_standard(Archive *)
Set the archive to be used as a standard.
Definition: SimPolnTiming.C:158
Result one_step()
One step in the simulation.
Definition: SimPolnTiming.C:520
bool vary_line_of_sight
Vary the line of sight.
Definition: General/Pulsar/SimPolnTiming.h:96
float measurement_noise
Relative noise in simulated observations.
Definition: General/Pulsar/SimPolnTiming.h:90
SimPolnTiming()
Default constructor.
Definition: SimPolnTiming.C:93
~SimPolnTiming()
Destructor.
Definition: SimPolnTiming.C:146
MEAL::Gaussian gaussian
The gaussian total intensity profile.
Definition: General/Pulsar/SimPolnTiming.h:66
void one_loop(unsigned level)
One loop in the simulation.
Definition: SimPolnTiming.C:188
MEAL::RotatingVectorModel rvm
The rotating vector model used to describe the position angle.
Definition: General/Pulsar/SimPolnTiming.h:69
Reference::To< Pulsar::Archive > archive
The data to use as a standard.
Definition: General/Pulsar/SimPolnTiming.h:158
Range slope
Number of steps when varying the RVM orientation.
Definition: General/Pulsar/SimPolnTiming.h:99
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void boost_around()
Find the phase shift due to boosts of varying orientation.
Definition: SimPolnTiming.C:340
PolnProfileFit fit
The arrival time estimation algorithm.
Definition: General/Pulsar/SimPolnTiming.h:63
void run_simulation()
Run the simulation, outputting results to cout.
Definition: SimPolnTiming.C:182
void susceptibility()
Account for noise in the standard profile.
Definition: SimPolnTiming.C:278
unsigned nbin
Number of bins in pulse profile.
Definition: General/Pulsar/SimPolnTiming.h:72
std::string title
Title written over plot.
Definition: General/Pulsar/SimPolnTiming.h:124
Range dgain
Number of steps when varying the differental gain.
Definition: General/Pulsar/SimPolnTiming.h:107
SyntheticPolnProfile generate
The synthetic polarimetric profile generator.
Definition: General/Pulsar/SimPolnTiming.h:60

Generated using doxygen 1.8.17