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
44 static double get_optimal_spacing (unsigned bits);
45
48
50 void set_Phi (double Phi);
51
53 void set_sigma_n (double sigma_n);
54
56 double get_hi () const { return hi; }
57
59 double get_lo () const { return lo; }
60
62 double get_A () const { return A; }
63
65 void set_threshold ( double t = get_optimal_spacing(2) );
67 double get_threshold () const { return threshold; }
68
70 double get_mean_Phi () const { return mean_Phi; }
72 void set_mean_Phi (double mean_Phi);
73
75 double get_var_Phi () const { return var_Phi; }
76
78 void get_prob_Phi (unsigned L, std::vector<float>& prob_Phi);
79
81 double A4 (double Phi);
82
84 double invert_A4 (double sigma_hat);
85
87 double A14 (double mean_Phi);
88
90 double invert_A14 (double sigma_hat);
91
93 class Probability;
94
96 class Plot;
97
99 class EquationA5;
100
102 void set_measured_prob_Phi (const Probability* data);
103
105 const Probability* get_measured_prob_Phi () const;
106
107
108 protected:
109
111 void set_alpha (double alpha, double Phi);
112
114 double threshold;
115
118
119 double lo;
120 double hi;
121 double A;
122 double mean_Phi;
123 double var_Phi;
124
125};
126
129
130public:
131
133 virtual unsigned get_nsample() const = 0;
134
136 virtual float get_threshold () const = 0;
137
139 virtual float get_cutoff_sigma () const = 0;
140
142 virtual unsigned get_ndig () const = 0;
143
145 virtual void get_histogram (std::vector<float>& h, unsigned dig) const = 0;
146
148 double evaluate (unsigned idig, double Phi, double* dprob_dPhi = 0);
149
150private:
151 unsigned last_idig;
152 std::vector<float> last_hist;
153
154};
155
156#endif
Interface to the measured distributions of Phi.
Definition JenetAnderson98.h:128
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 evaluate(unsigned idig, double Phi, double *dprob_dPhi=0)
Evaluate the probability of Phi for the specified digitizer.
Definition JenetAnderson98.C:215
virtual void get_histogram(std::vector< float > &h, unsigned dig) const =0
Get the specified histogram.
virtual unsigned get_nsample() const =0
Get the number of samples in each histogram.
virtual float get_cutoff_sigma() const =0
Get the cut off power for impulsive interference excision.
Reference::To< const Probability > measured
The interface to a measured probability distribution of Phi.
Definition JenetAnderson98.h:117
void set_threshold(double t=get_optimal_spacing(2))
Set the sampling threshold.
Definition JenetAnderson98.C:105
static double get_optimal_spacing(unsigned bits)
Table 3 - Optimum Input Threshold Spacing for a Uniform Digitizer.
Definition JenetAnderson98.C:15
double get_threshold() const
Get the sampling threshold.
Definition JenetAnderson98.h:67
JenetAnderson98()
Default constructor.
Definition JenetAnderson98.C:41
void set_Phi(double Phi)
Set the fraction of samples in the low voltage state.
Definition JenetAnderson98.C:53
double threshold
The sampling threshold.
Definition JenetAnderson98.h:114
double get_mean_Phi() const
Get the expectation value of Phi, JA98 Eq.A2.
Definition JenetAnderson98.h:70
void set_sigma_n(double sigma_n)
Set the normalized, undigitized power.
Definition JenetAnderson98.C:63
double get_var_Phi() const
Get the variance of Phi.
Definition JenetAnderson98.h:75
double invert_A4(double sigma_hat)
Given the digitized power, return Phi.
Definition JenetAnderson98.C:184
double A4(double Phi)
Given Phi, return the digitized power.
Definition JenetAnderson98.C:173
double get_lo() const
Get the optimal low voltage output levels, JA98 Eq.41.
Definition JenetAnderson98.h:59
void set_measured_prob_Phi(const Probability *data)
Set the measured probability distribution of Phi.
Definition JenetAnderson98.C:204
void get_prob_Phi(unsigned L, std::vector< float > &prob_Phi)
Get the theoretical probability distribution of Phi, JA98 Eq.A6.
Definition JenetAnderson98.C:155
double A14(double mean_Phi)
Given <Phi>, return the digitized power.
Definition JenetAnderson98.C:190
const Probability * get_measured_prob_Phi() const
Set the measured probability distribution of Phi.
Definition JenetAnderson98.C:210
void set_mean_Phi(double mean_Phi)
Set the expectation value of Phi.
Definition JenetAnderson98.C:116
double get_A() const
Get the slope of digitized vs undigitized correlation, JA98 Eq.43.
Definition JenetAnderson98.h:62
double get_hi() const
Get the optimal high voltage output levels, JA98 Eq.40.
Definition JenetAnderson98.h:56
void set_alpha(double alpha, double Phi)
Set the inverse width of the gaussian, sort of.
Definition JenetAnderson98.C:70
double invert_A14(double sigma_hat)
Given the digitized power, return <Phi>
Definition JenetAnderson98.C:197
Base class of probability density functions.
Definition Probability.h:15
Manages Reference::To references to the instance.
Definition ReferenceAble.h:35
Template class manages Reference::Able objects.
Definition ReferenceTo.h:25

Generated using doxygen 1.14.0