DigitiserCountsPlot.h
1 /***************************************************************************
2  *
3  * Copyright (C) 2007 by David Smith
4  * Licensed under the Academic Free License version 2.1
5  *
6  ***************************************************************************/
7 
8 
9 
10 #ifndef DIGITISER_COUNTS_PLOT_H_
11 #define DIGITISER_COUNTS_PLOT_H_
12 
13 
14 
15 #include "Pulsar/SimplePlot.h"
16 #include <Pulsar/DigitiserCounts.h>
17 #include <vector>
18 
19 
20 
21 using std::pair;
22 using std::vector;
23 
24 
25 
26 namespace Pulsar
27 {
30  {
31  public:
33 
35 
37  void preprocess (Archive* archive);
38 
39  class Interface : public TextInterface::To<DigitiserCountsPlot>
40  {
41  public:
42  Interface( DigitiserCountsPlot *s_instance = NULL );
43  };
44 
45  void CheckCounts( const Archive *data );
46 
47  void prepare( const Archive *data );
48  void draw( const Archive *data );
49 
50  std::string get_xlabel( const Archive *data );
51  std::string get_ylabel( const Archive *data );
52 
53  pair<int,int> get_srange() const { return srange; }
54  void set_srange( const pair<int,int> &s_srange ) { srange = s_srange; }
55  void set_srange( int fsub, int lsub ) { set_srange( pair<int,int>( fsub, lsub) ); }
56 
57  int get_subint( void ) const { return subint; }
58  void set_subint( int s_subint ) { subint = s_subint; }
59 
60  bool get_logscale () const { return logscale; }
61  void set_logscale (bool f) { logscale = f; }
62 
63  // fraction of the maximum below which data are considered zero
64  double get_zero_threshold () const { return zero_threshold; }
65  void set_zero_threshold (double f) { zero_threshold = f; }
66 
67  private:
68  double zero_threshold;
69  bool logscale;
70 
71  float min_count;
72  float max_count;
73  float y_jump;
74  int first_nz;
75  int last_nz;
76  int subint;
77  pair<int,int> srange;
78 
79  bool valid_data;
80  };
81 }
82 
83 
84 
85 #endif
86 
87 
DigitiserCountsPlot()
Constructor.
Definition: DigitiserCountsPlot.C:35
void CheckCounts(const Archive *data)
CheckCounts.
Definition: DigitiserCountsPlot.C:81
void draw(const Archive *data)
draw
Definition: DigitiserCountsPlot.C:273
Plots a histogram of the DigitiserCounts.
Definition: DigitiserCountsPlot.h:29
Plots a single plot.
Definition: SimplePlot.h:38
void preprocess(Archive *archive)
disable default pre-processing of Plot base class
Definition: DigitiserCountsPlot.C:64
PlotScale * get_y_scale(bool allow_transpose)
Get the x-scale.
Definition: PlotFrame.C:213
void set_buf_norm(float f)
Set the world-normalized buffer space on either side of the axis.
Definition: PlotScale.h:95
The primary interface to pulsar observational data.
Definition: Archive.h:45
Type * get() const
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
std::string get_ylabel(const Archive *data)
get_ylabel
Definition: DigitiserCountsPlot.C:402
void prepare(const Archive *data)
prepare
Definition: DigitiserCountsPlot.C:120
Stores digitizer histograms.
Definition: DigitiserCounts.h:25
static bool verbose
Verbosity flag.
Definition: Plot.h:33
PlotScale * get_x_scale(bool allow_transpose)
Get the x-scale.
Definition: PlotFrame.C:189
void get_range_external(float &min, float &max) const
Return min and max scaled according to zoom.
Definition: PlotScale.C:186
virtual PlotFrame * get_frame()
Get the frame.
Definition: FramedPlot.C:27
TextInterface::Parser * get_interface()
get_interface
Definition: DigitiserCountsPlot.C:58
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_minmax(float min, float max)
Set the minimum and maximum value in the data.
Definition: PlotScale.C:57
std::string get_xlabel(const Archive *data)
get_xlabel
Definition: DigitiserCountsPlot.C:385

Generated using doxygen 1.8.17