DigitiserStatistics.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2003 by Aidan Hotan
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // Class for holding digitiser statistics
10 
11 #ifndef __DigitiserStatistics_h
12 #define __DigitiserStatistics_h
13 
14 #include "Pulsar/ArchiveExtension.h"
15 
16 namespace Pulsar
17 {
18 
20  class DigitiserStatistics : public Pulsar::Archive::Extension
21  {
22 
23  public:
24 
25  //Default constructor
27 
28  // Copy constructor
29  DigitiserStatistics (const DigitiserStatistics& extension);
30 
31  // Operator =
32  const DigitiserStatistics& operator= (const DigitiserStatistics&);
33 
34  // Destructor
36 
38  DigitiserStatistics* clone () const
39  { return new DigitiserStatistics( *this ); }
40 
43  class Interface;
44 
46  std::string get_short_name () const { return "dig"; }
47 
49  void set_ndigr( int s_ndigr ) { ndigr = s_ndigr; }
50 
52  int get_ndigr( void ) const { return ndigr; }
53 
55  void set_npar( int s_npar ) { npar = s_npar; }
56 
58  int get_npar( void ) const { return npar; }
59 
61  void set_ncycsub( int s_ncycsub ) { ncycsub = s_ncycsub; }
62 
64  int get_ncycsub( void ) const { return ncycsub; }
65 
67  void set_diglev( std::string s_diglev ) { diglev = s_diglev; }
68 
70  std::string get_diglev( void ) const { return diglev; }
71 
73  void set_dig_mode( std::string s_dig_mode ) { dig_mode = s_dig_mode; }
74 
76  std::string get_dig_mode( void ) const { return dig_mode; }
77 
79  void resize (unsigned nsubint,
80  unsigned npol = 0,
81  unsigned nchan = 0,
82  unsigned nbin = 0);
83 
85  // The information container
86 
87  class row : public Reference::Able
88  {
89 
90  public:
91 
92  row () { init(); }
93  ~row ();
94 
95  float get_atten (unsigned index) const { return atten.at(index); }
96  void set_atten (unsigned index, float value) { atten.at(index) = value; }
97  unsigned get_natten () const { return atten.size(); }
98 
99  int index;
100 
101  std::vector<float> atten;
102  std::vector<float> data;
103 
104  private:
105 
106  void init ();
107 
108  };
109 
110  std::vector<row> rows;
111 
112  DigitiserStatistics::row& get_row (unsigned i);
113  DigitiserStatistics::row& get_last ();
114 
115  DigitiserStatistics::row* get_row_ptr (unsigned i) { return &rows.at(i); }
116  unsigned get_nrow () const { return rows.size(); }
117 
118  void push_blank_row ();
119 
120  private:
121 
122  int ndigr;
123  int npar;
124  int ncycsub;
125  std::string diglev;
126  std::string dig_mode;
127 
128  void init ();
129 
130  };
131 
132 }
133 
134 #endif
void add(T(P::*get)() const, const char *name, const char *description=0)
int get_ndigr(void) const
get_ndigr
Definition: DigitiserStatistics.h:62
Plots a histogram of the DigitiserCounts.
Definition: DigitiserCountsPlot.h:29
std::string get_dig_mode(void) const
get dig_mode
Definition: DigitiserStatistics.h:86
void set_diglev(std::string s_diglev)
set diglev
Definition: DigitiserStatistics.h:77
std::string get_diglev(void) const
get diglev
Definition: DigitiserStatistics.h:80
std::string get_short_name() const
Return an abbreviated name that can be typed relatively quickly.
Definition: DigitiserStatistics.h:56
virtual void set_instance(C *c)
void resize(unsigned nsubint, unsigned npol=0, unsigned nchan=0, unsigned nbin=0)
Resize the extension.
Definition: DigitiserStatistics.C:88
int get_npar(void) const
get npar
Definition: DigitiserStatistics.h:68
DigitiserStatistics * clone() const
Clone method.
Definition: DigitiserStatistics.h:48
void set_dig_mode(std::string s_dig_mode)
set dig_mode
Definition: DigitiserStatistics.h:83
Stores digitizer statistics.
Definition: DigitiserStatistics.h:25
Definition: ArchiveExtension.h:28
TextInterface::Parser * get_interface()
Return a text interfaces that can be used to access this instance.
Definition: DigitiserStatistics.C:139
void set_ndigr(int s_ndigr)
set ndigr
Definition: DigitiserStatistics.h:59
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_ncycsub(int s_ncycsub)
set ncycsub
Definition: DigitiserStatistics.h:71
void set_npar(int s_npar)
set npar
Definition: DigitiserStatistics.h:65
int get_ncycsub(void) const
get ncycsub
Definition: DigitiserStatistics.h:74

Generated using doxygen 1.8.17