TwoBitStats.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2003 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Base/Extensions/Pulsar/TwoBitStats.h
10
11#ifndef __TwoBitStats_h
12#define __TwoBitStats_h
13
14#include "Pulsar/ArchiveExtension.h"
15
16namespace Pulsar {
17
19
24
26
27 public:
28
30 TwoBitStats ();
31
33 TwoBitStats (const TwoBitStats& extension);
34
36 const TwoBitStats& operator= (const TwoBitStats& extension);
37
39 TwoBitStats* clone () const { return new TwoBitStats( *this ); }
40
42 void resize (unsigned nsample, unsigned ndig);
43
45 unsigned get_ndig () const;
46
48 unsigned get_nsample () const;
49
51 void set_threshold (float threshold);
52
54 float get_threshold () const { return threshold; }
55
57 void set_cutoff_sigma (float cutoff_sigma);
58
60 float get_cutoff_sigma () const { return cutoff_sigma; }
61
63 const std::vector<float>& get_histogram (unsigned idig) const;
64
66 void set_histogram (const std::vector<float>&, unsigned idig);
67
69 void zero ();
70
72 double get_mean_Phi (unsigned idig) const;
73
75 double get_distortion (unsigned idig) const;
76
77 protected:
78
80 unsigned ndig;
81
83 unsigned nsample;
84
86 float threshold;
87
90
92 std::vector< std::vector<float> > histogram;
93
95 void range_check (unsigned idig, const char* method) const;
96
97 };
98
99}
100
101#endif
Definition ArchiveExtension.h:24
std::vector< std::vector< float > > histogram
Low-voltage state count histograms.
Definition TwoBitStats.h:92
void set_histogram(const std::vector< float > &, unsigned idig)
Set the specified histogram.
Definition TwoBitStats.C:105
TwoBitStats * clone() const
Clone method.
Definition TwoBitStats.h:39
unsigned nsample
Number of samples used to estimate undigitized power.
Definition TwoBitStats.h:83
float threshold
Sampling threshold as a fraction of the noise power.
Definition TwoBitStats.h:86
float cutoff_sigma
Cut off power used for impulsive interference excision.
Definition TwoBitStats.h:89
float get_threshold() const
Get the sampling threshold as a fraction of the noise power.
Definition TwoBitStats.h:54
unsigned ndig
Number of digitizers.
Definition TwoBitStats.h:80
double get_distortion(unsigned idig) const
Get the difference between the measured and theoretical distributions.
Definition TwoBitStats.C:129
void set_threshold(float threshold)
Set the sampling threshold as a fraction of the noise power.
Definition TwoBitStats.C:62
unsigned get_ndig() const
Get the number of digitizers.
Definition TwoBitStats.C:56
unsigned get_nsample() const
Get the number of time samples used to estimate undigitized power.
Definition TwoBitStats.C:50
void range_check(unsigned idig, const char *method) const
Throw an exception if idig out of range.
Definition TwoBitStats.C:117
double get_mean_Phi(unsigned idig) const
Get the mean fraction of low voltage states.
Definition TwoBitStats.C:123
TwoBitStats()
Default constructor.
Definition TwoBitStats.C:17
const TwoBitStats & operator=(const TwoBitStats &extension)
Operator =.
Definition TwoBitStats.C:36
const std::vector< float > & get_histogram(unsigned idig) const
Get the specified histogram.
Definition TwoBitStats.C:98
void zero()
Set all histogram data to zero.
Definition TwoBitStats.C:89
float get_cutoff_sigma() const
Get the cut off power for impulsive interference excision.
Definition TwoBitStats.h:60
void set_cutoff_sigma(float cutoff_sigma)
Set the cut off power used for impulsive interference excision.
Definition TwoBitStats.C:68
void resize(unsigned nsample, unsigned ndig)
Set the number of samples per estimate and number of digitizers.
Definition TwoBitStats.C:74
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0