LinePhasePlot.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2007 by David Smith
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Plotting/Pulsar/LinePhasePlot.h
10 
11 
12 
13 #ifndef LINE_PHASE_PLOT_H_
14 #define LINE_PHASE_PLOT_H_
15 
16 
17 
18 #include <Pulsar/Archive.h>
19 #include <Pulsar/Profile.h>
20 #include "Pulsar/PhasePlot.h"
21 
22 
23 
24 using std::pair;
25 using std::vector;
26 using Pulsar::Archive;
27 using Pulsar::Profile;
28 using Pulsar::PhasePlot;
29 
30 
31 
32 namespace Pulsar
33 {
34 
36  class LinePhasePlot : public PhasePlot
37  {
38  public:
39  LinePhasePlot();
40 
42  void prepare (const Archive *data );
43 
45  void draw( const Archive *data );
46 
47  // Text interface for LinePhasePlot
48  class Interface : public TextInterface::To<LinePhasePlot>
49  {
50  public:
51  Interface( LinePhasePlot *s_instance = NULL );
52  };
53 
56 
58  int get_isub( void ) const { return srange.first; }
59 
61  void set_isub( int s_isub ) { srange.first = srange.second = s_isub; }
62 
64  pair<int,int> get_srange() const { return srange; }
65 
67  void set_srange( const pair<int,int> &s_srange ) { srange = s_srange; }
68 
70  int get_ipol( void ) const { return ipol; }
71 
73  void set_ipol( int s_ipol ) { ipol = s_ipol; }
74 
76  int get_ichan() const { return ichan; }
77 
79  void set_ichan( const int &s_ichan ) { ichan = s_ichan; }
80 
82  int get_line_colour() const { return line_colour; }
83 
85  void set_line_colour( const int &s_line_colour ) { line_colour = s_line_colour; }
86 
87  private:
88  // polarization to plot
89  int ipol;
90 
91  // channel to plot
92  int ichan;
93 
94  // range of subints to plot
95  pair<int,int> srange;
96 
97  // The maximum different maxamp - minamp of all relevant subints
98  float amp_range;
99 
100  // how much space(%) to add above and below the plot
101  float y_buffer_norm;
102 
103  // The line colour
104  int line_colour;
105  };
106 }
107 
108 
109 #endif
110 
Draw a set of profiles for subints stacked ontop of eachother.
Definition: LinePhasePlot.h:36
void set_line_colour(const int &s_line_colour)
Set the line colour.
Definition: LinePhasePlot.h:85
void set_isub(int s_isub)
Set the subint range to (x,x)
Definition: LinePhasePlot.h:61
int get_isub(void) const
Get the first index of the subint range.
Definition: LinePhasePlot.h:58
virtual unsigned get_nsubint() const =0
Get the number of sub-integrations stored in the file.
PlotAxis * get_y_axis(bool allow_transpose)
Get the y-axis.
Definition: PlotFrame.C:228
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
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
The primary interface to pulsar observational data.
Definition: Archive.h:45
pair< int, int > get_srange() const
Get the range of subints to plot.
Definition: LinePhasePlot.h:64
int get_ichan() const
Get the frequency channel to plot.
Definition: LinePhasePlot.h:76
void prepare(const Archive *data)
prepare the archive for rendering
Definition: LinePhasePlot.C:58
void set_alternate(bool f)
Set if the frame opposite the axis may have an alternate scale.
Definition: PlotAxis.h:55
Integration * get_Integration(unsigned subint)
Return pointer to the specified Integration.
Definition: IntegrationManager.C:41
void set_tick(float f)
Set the tick to be passed to pgbox for this axis.
Definition: PlotAxis.h:65
int get_ipol(void) const
Get the polarization to plot.
Definition: LinePhasePlot.h:70
void set_ichan(const int &s_ichan)
Set the frequency channel to plot.
Definition: LinePhasePlot.h:79
void draw(const Archive *data)
draw the archive
Definition: LinePhasePlot.C:119
int get_line_colour() const
Get the line colour.
Definition: LinePhasePlot.h:82
void set_ipol(int s_ipol)
Set the polarization to plot.
Definition: LinePhasePlot.h:73
virtual PlotFrame * get_frame()
Get the frame.
Definition: FramedPlot.C:27
void set_label(const std::string &_label, bool overwrite)
Set the label to be drawn on the axis.
Definition: PlotAxis.C:37
Simple plots with pulse phase along the x-axis.
Definition: PhasePlot.h:27
void set_srange(const pair< int, int > &s_srange)
Set the range of subints to plot.
Definition: LinePhasePlot.h:67
std::vector< float > get_weighted_amps() const
Definition: Profile.C:346
LinePhasePlot()
Constructor Assume the subint, or range of subints are unset until we know how many there are Assume ...
Definition: LinePhasePlot.C:37
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
virtual unsigned get_nbin() const =0
Get the number of pulsar phase bins used.
void set_world_external(const std::pair< float, float > &f)
Set the world coordinate range printed on the axis.
Definition: PlotScale.C:108
TextInterface::Parser * get_interface()
Get a LinePhasePlot::Interface for this object.
Definition: LinePhasePlot.C:158
void set_minmax(float min, float max)
Set the minimum and maximum value in the data.
Definition: PlotScale.C:57

Generated using doxygen 1.8.17