JenetAnderson98.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2006 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Util/genutil/JenetAnderson98.h
10 
11 #ifndef __Jenet_Anderson_98
12 #define __Jenet_Anderson_98
13 
14 #include "Reference.h"
15 #include <vector>
16 
18 
39 
40  public:
41 
43  static double get_optimal_spacing (unsigned bits);
44 
46  JenetAnderson98 ();
47 
49  void set_Phi (double Phi);
50 
52  void set_sigma_n (double sigma_n);
53 
55  double get_hi () const { return hi; }
56 
58  double get_lo () const { return lo; }
59 
61  double get_A () const { return A; }
62 
64  void set_threshold ( double t = get_optimal_spacing(2) );
66  double get_threshold () const { return threshold; }
67 
69  double get_mean_Phi () const { return mean_Phi; }
71  void set_mean_Phi (double mean_Phi);
72 
74  double get_var_Phi () const { return var_Phi; }
75 
77  void get_prob_Phi (unsigned L, std::vector<float>& prob_Phi);
78 
80  double A4 (double Phi);
81 
83  double invert_A4 (double sigma_hat);
84 
86  double A14 (double mean_Phi);
87 
89  double invert_A14 (double sigma_hat);
90 
92  class Probability;
93 
95  class Plot;
96 
98  class EquationA5;
99 
101  void set_measured_prob_Phi (const Probability* data);
102 
104  const Probability* get_measured_prob_Phi () const;
105 
106 
107  protected:
108 
110  void set_alpha (double alpha, double Phi);
111 
113  double threshold;
114 
117 
118  double lo;
119  double hi;
120  double A;
121  double mean_Phi;
122  double var_Phi;
123 
124 };
125 
128 
129 public:
130 
132  virtual unsigned get_nsample() const = 0;
133 
135  virtual float get_threshold () const = 0;
136 
138  virtual float get_cutoff_sigma () const = 0;
139 
141  virtual unsigned get_ndig () const = 0;
142 
144  virtual void get_histogram (std::vector<float>& h, unsigned dig) const = 0;
145 
147  double evaluate (unsigned idig, double Phi, double* dprob_dPhi = 0);
148 
149 private:
150  unsigned last_idig;
151  std::vector<float> last_hist;
152 
153 };
154 
155 #endif
void set_Phi(double Phi)
Set the fraction of samples in the low voltage state.
Definition: JenetAnderson98.C:43
double get_var_Phi() const
Get the variance of Phi.
Definition: JenetAnderson98.h:79
virtual float get_cutoff_sigma() const =0
Get the cut off power for impulsive interference excision.
void set_mean_Phi(double mean_Phi)
Set the expectation value of Phi.
Definition: JenetAnderson98.C:106
double A14(double mean_Phi)
Given <Phi>, return the digitized power.
Definition: JenetAnderson98.C:180
virtual unsigned get_ndig() const =0
Get the number of digitizers.
virtual float get_threshold() const =0
Get the sampling threshold as a fraction of the noise power.
double get_mean_Phi() const
Get the expectation value of Phi, JA98 Eq.A2.
Definition: JenetAnderson98.h:74
virtual void get_histogram(std::vector< float > &h, unsigned dig) const =0
Get the specified histogram.
double get_A() const
Get the slope of digitized vs undigitized correlation, JA98 Eq.43.
Definition: JenetAnderson98.h:66
A convenient exception handling class.
Definition: Error.h:54
virtual unsigned get_nsample() const =0
Get the number of samples in each histogram.
const Probability * get_measured_prob_Phi() const
Set the measured probability distribution of Phi.
Definition: JenetAnderson98.C:200
JenetAnderson98()
Default constructor.
Definition: JenetAnderson98.C:31
void set_threshold(double t=get_optimal_spacing(2))
Set the sampling threshold.
Definition: JenetAnderson98.C:95
Reference::To< const Probability > measured
The interface to a measured probability distribution of Phi.
Definition: JenetAnderson98.h:121
double get_threshold() const
Get the sampling threshold.
Definition: JenetAnderson98.h:71
Template class manages Reference::Able objects.
Definition: Reference.h:74
double get_hi() const
Get the optimal high voltage output levels, JA98 Eq.40.
Definition: JenetAnderson98.h:60
Statistics of two-bit quantization and artifact correction parameters.
Definition: JenetAnderson98.h:38
Manages Reference::To references to the instance.
Definition: ReferenceAble.h:40
Interface to the measured distributions of Phi.
Definition: JenetAnderson98.h:127
Base class of probability density functions.
Definition: Probability.h:15
Implements an adaptable function object in compliance with the STL.
Definition: Functor.h:39
double A4(double Phi)
Given Phi, return the digitized power.
Definition: JenetAnderson98.C:163
void set_sigma_n(double sigma_n)
Set the normalized, undigitized power.
Definition: JenetAnderson98.C:53
double threshold
The sampling threshold.
Definition: JenetAnderson98.h:118
double invert_A4(double sigma_hat)
Given the digitized power, return Phi.
Definition: JenetAnderson98.C:174
void get_prob_Phi(unsigned L, std::vector< float > &prob_Phi)
Get the theoretical probability distribution of Phi, JA98 Eq.A6.
Definition: JenetAnderson98.C:145
double get_lo() const
Get the optimal low voltage output levels, JA98 Eq.41.
Definition: JenetAnderson98.h:63
void set_measured_prob_Phi(const Probability *data)
Set the measured probability distribution of Phi.
Definition: JenetAnderson98.C:194
static double get_optimal_spacing(unsigned bits)
Table 3 - Optimum Input Threshold Spacing for a Uniform Digitizer.
Definition: JenetAnderson98.C:15
double evaluate(unsigned idig, double Phi, double *dprob_dPhi=0)
Evaluate the probability of Phi for the specified digitizer.
Definition: JenetAnderson98.C:205
double invert_A14(double sigma_hat)
Given the digitized power, return <Phi>
Definition: JenetAnderson98.C:187
void set_alpha(double alpha, double Phi)
Set the inverse width of the gaussian, sort of.
Definition: JenetAnderson98.C:60

Generated using doxygen 1.8.17