BitStatsPlotter.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 // dspsr/Signal/General/dsp/BitStatsPlotter.h
10 
11 #ifndef __BitStatsPlotter_h
12 #define __BitStatsPlotter_h
13 
14 #include <vector>
15 
16 #include "Reference.h"
17 
18 namespace dsp {
19 
20  class HistUnpacker;
21 
23  class BitStatsPlotter : public Reference::Able {
24 
25  public:
26 
29 
31  virtual ~BitStatsPlotter ();
32 
34  virtual void set_data (const HistUnpacker* stats);
35 
37  void set_colours (const std::vector<int>& colours);
38 
40  void zap (unsigned ibin) { to_zap.push_back(ibin); }
41 
43  void plot (unsigned ichan, unsigned ipol);
44 
46  void label ();
47 
49  virtual std::string get_xlabel () const;
50 
52  virtual std::string get_ylabel () const;
53 
55  bool full_xscale;
56 
58  float hist_min;
59 
65 
67  void set_viewport (float xmin, float xmax, float ymin, float ymax);
68 
70  bool horizontal;
71 
73  bool colour;
74 
76  void plot ();
77 
79 
80  protected:
81 
83 
84  virtual bool special (unsigned imin, unsigned imax, float& ymax)
85  { return false; }
86 
88  std::vector<float> histogram;
89 
91  std::vector<int> colours;
92 
93  std::vector<unsigned> to_zap;
94 
96  virtual void check_colours ();
97 
99  void cpgpt (std::vector<float>& vals, int type);
100 
102  float xscale;
103 
104  private:
105 
107  float vpxmin;
108  float vpxmax;
109  float vpymin;
110  float vpymax;
111 
114 
115 
116  };
117 
118 }
119 
120 #endif
std::vector< int > colours
Colour used when plotting histogram from each digitizer.
Definition: BitStatsPlotter.h:96
virtual std::string get_ylabel() const
The label on the y-axis.
Definition: BitStatsPlotter.C:40
void cpgpt(std::vector< float > &vals, int type)
Plot a vector of points with index on x-axis.
Definition: BitStatsPlotter.C:53
Bit unpacker that keeps a histogram and optimal statistics.
Definition: HistUnpacker.h:25
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
void plot()
Plot two polarizations in the current viewport.
Definition: BitStatsPlotter.C:146
float xscale
Scale factor multplied by each index on x axis.
Definition: BitStatsPlotter.h:107
void set_viewport(float xmin, float xmax, float ymin, float ymax)
Set the device-normalized coordinates of viewport frame.
Definition: BitStatsPlotter.C:137
bool colour
Plot in colour.
Definition: BitStatsPlotter.h:78
std::vector< float > histogram
Where individual histograms are kept for plotting.
Definition: BitStatsPlotter.h:93
virtual std::string get_xlabel() const
The label on the x-axis.
Definition: BitStatsPlotter.C:35
float hist_min
Fraction of histogram maximum below which points are ignored.
Definition: BitStatsPlotter.h:63
virtual bool special(unsigned imin, unsigned imax, float &ymax)
Any special plotting implemented in derived classes.
Definition: BitStatsPlotter.h:89
BitStatsPlotter()
Null constructor.
Definition: BitStatsPlotter.C:17
virtual void set_data(const HistUnpacker *stats)
Set the data to be plotted.
Definition: BitStatsPlotter.C:45
void label()
Label the plot.
Definition: BitStatsPlotter.C:99
virtual ~BitStatsPlotter()
Virtual destructor.
Definition: BitStatsPlotter.C:31
void set_colours(const std::vector< int > &colours)
Set the plot colour used for each digitizer.
Definition: BitStatsPlotter.C:64
std::vector< unsigned > to_zap
Plot the two polarizations beside eachother.
Definition: BitStatsPlotter.h:98
bool full_xscale
Plot the entire x-axis of the histogram.
Definition: BitStatsPlotter.h:60
void zap(unsigned ibin)
Zap the specified histogram by setting its value to zero.
Definition: BitStatsPlotter.h:45
bool horizontal
Plot the two polarizations beside eachother.
Definition: BitStatsPlotter.h:75
virtual void check_colours()
Ensure that colours for different digitizers are unique.
Definition: BitStatsPlotter.C:70

Generated using doxygen 1.8.17