General/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 
50 
52  ~SimPolnTiming ();
53 
56 
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
const ScalarMath exp(const ScalarMath &x)
bool as_Estimate
Output values using Estimate operator <<.
Definition: General/Pulsar/SimPolnTiming.h:127
Phenomenological description of the instrument.
Definition: Instrument.h:31
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
void set_boost(unsigned i, const Estimate< double > &b_i)
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
Stores a weight for each Profile phase bin.
Definition: PhaseWeight.h:29
std::ostream * output
Output stream.
Definition: General/Pulsar/SimPolnTiming.h:130
const ScalarMath sin(const ScalarMath &x)
Analysis of the matrix template matching algorithm.
Definition: PolnProfileFitAnalysis.h:30
Reference::To< ScalarParameter > reference_position_angle
float standard_noise
Relative noise in standard profile.
Definition: General/Pulsar/SimPolnTiming.h:78
The primary interface to pulsar observational data.
Definition: Archive.h:45
Estimate< double > get_variance() const
Get the weighted variance of the Profile amplitudes.
Definition: PhaseWeight.C:351
const ScalarMath pow(const ScalarMath &x, const ScalarMath &y)
float offset
Phase offset of simulated observations.
Definition: General/Pulsar/SimPolnTiming.h:93
U get_error() const
Reference::To< ScalarParameter > magnetic_axis
const ScalarMath sqrt(const ScalarMath &x)
unsigned iterations
Number of simulated observations for each step in simulation.
Definition: General/Pulsar/SimPolnTiming.h:87
Estimates phase shift in Fourier domain.
Definition: PhaseGradShift.h:27
const ScalarMath abs(const ScalarMath &x)
void set_centre(double)
Set the phase of the standard profile centre.
Definition: SimPolnTiming.C:151
void set_observation(const Profile *p)
Set the profile from which the shift will be estimated.
Definition: ProfileShiftEstimator.h:36
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
Simulated polarimetric pulse profile.
Definition: General/Pulsar/SyntheticPolnProfile.h:28
void set_orientation(unsigned ireceptor, const Estimate< double > &theta)
Set the orientation, , of the specified receptor in radians.
Definition: Instrument.C:99
Reference::To< ScalarParameter > line_of_sight
bool vary_line_of_sight
Vary the line of sight.
Definition: General/Pulsar/SimPolnTiming.h:96
void set_maximum_harmonic(unsigned max)
Set the maximum number of harmonics to include in fit.
Definition: PhaseGradShift.C:45
void set_height(double height)
Adaptively computes the baseline, assuming normally distributed noise.
Definition: GaussianBaseline.h:70
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
T get_value() const
bool verbose
Definition: timer++.C:25
virtual void get_weight(PhaseWeight *weight)
Returns a PhaseWeight with the Profile attribute set.
Definition: ProfileWeightFunction.C:26
void set_fit(PolnProfileFit *)
Set the PolnProfileFit algorithm to be analysed.
Definition: PolnProfileFitAnalysis.C:256
void set_diff_gain(const Estimate< double > &gamma)
Set the differential gain, , in hyperbolic radians.
Definition: VariableBackend.C:108
virtual void set_Profile(const Profile *)
Set the Profile from which the PhaseWeight will be derived.
Definition: ProfileWeightFunction.C:20
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
const ScalarMath cos(const ScalarMath &x)
const VariableBackend * get_backend() const
Provide access to the backend model.
Definition: BackendFeed.C:60
Range slope
Number of steps when varying the RVM orientation.
Definition: General/Pulsar/SimPolnTiming.h:99
void set_position_angle(MEAL::Univariate< MEAL::Scalar > *)
Set the functional form of the position angle.
Definition: SyntheticPolnProfile.C:78
void set_total_intensity(MEAL::Univariate< MEAL::Scalar > *)
Set the functional form of the total intensity.
Definition: SyntheticPolnProfile.C:34
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_degree(MEAL::Univariate< MEAL::Scalar > *)
Set the functional form of the degree of polarization.
Definition: SyntheticPolnProfile.C:39
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
const ScalarMath atan2(const ScalarMath &y, const ScalarMath &x)
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
The matrix template matching algorithm.
Definition: PolnProfileFit.h:50
unsigned nbin
Number of bins in pulse profile.
Definition: General/Pulsar/SimPolnTiming.h:72
void set_period(double period)
std::string title
Title written over plot.
Definition: General/Pulsar/SimPolnTiming.h:124
Estimate< double > get_shift() const
Return the best-fit estimate of the phase shift in turns.
Definition: PhaseGradShift.C:63
Range dgain
Number of steps when varying the differental gain.
Definition: General/Pulsar/SimPolnTiming.h:107
void set_width(double width)
static double get_optimal_spacing(unsigned bits)
double cumulative_distribution(double x)
SyntheticPolnProfile generate
The synthetic polarimetric profile generator.
Definition: General/Pulsar/SimPolnTiming.h:60
void set_Profile(const Profile *profile) const
Set the Profile from which statistics are calculated.
Definition: PhaseWeight.C:303
void set_standard(const Profile *p)
Set the profile with respect to which the shift will be estimated.
Definition: PhaseGradShift.C:57

Generated using doxygen 1.8.17