FluxPlot.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2006 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Plotting/Pulsar/FluxPlot.h
10
11#ifndef __Pulsar_FluxPlot_h
12#define __Pulsar_FluxPlot_h
13
14#include "Pulsar/PhasePlot.h"
15#include "Pulsar/ProfileVectorPlotter.h"
16#include "Pulsar/Index.h"
17
18namespace Pulsar {
19
20 class Profile;
21 class PhaseWeight;
22 class InfoLabel;
23
25 class FluxPlot : public PhasePlot {
26
27 public:
28
30 FluxPlot ();
31
33 ~FluxPlot ();
34
37
38 // Text interface to the FluxPlot class
39 class Interface : public TextInterface::To<FluxPlot> {
40 public:
41 Interface (FluxPlot* = 0);
42 };
43
45 void prepare (const Archive*);
46
48 std::string get_ylabel (const Archive*);
49
51 virtual void get_profiles (const Archive*) = 0;
52
54 virtual float get_phase_error (const Archive* data);
55
57 virtual float get_flux_error (const Profile* data);
58
60 virtual float get_flux_maximum (const Profile* data);
61
63 virtual void plot_error_box (const Archive* data);
64
66 virtual void auto_scale_phase (const Profile* data, float buffer);
67
69 void set_subint (Index _isubint) { isubint = _isubint; }
70 Index get_subint () const { return isubint; }
71
73 void set_chan (Index _ichan) { ichan = _ichan; }
74 Index get_chan () const { return ichan; }
75
77 void set_pol (Index _ipol) { ipol = _ipol; }
78 Index get_pol () const { return ipol; }
79
81 void set_logarithmic (int val) { logarithmic = val; }
82 int get_logarithmic () const { return logarithmic; }
83
85 void set_peak_zoom (float zoom) { peak_zoom = zoom; }
86 float get_peak_zoom () const { return peak_zoom; }
87
89 void set_baseline_zoom (float zoom) { baseline_zoom = zoom; }
90 float get_baseline_zoom () const { return baseline_zoom; }
91
93 void set_info_label (bool flag = true);
94 bool get_info_label () const;
95
97 void set_plot_error_box (int code) { plot_ebox = code; }
98 int get_plot_error_box () const { return plot_ebox; }
99
101 void set_plot_histogram (bool f = true) { plotter.plot_histogram = f; }
102 bool get_plot_histogram () const { return plotter.plot_histogram; }
103
105
107 void set_original_nchan (unsigned nchan) { original_nchan = nchan; }
108 unsigned get_original_nchan () const { return original_nchan; }
109
111 void draw (const Archive*);
112
114
117 void plot_profile (const Profile*);
118
120 const ProfileVectorPlotter* get_plotter () const { return &plotter; }
121
123 void set_selection (const PhaseWeight*);
124
126 void set_crop( float new_crop ) { crop = new_crop; }
127
129 float get_crop() const { return crop; }
130
131 protected:
132
133 ProfileVectorPlotter plotter;
134
135 Index isubint;
136 Index ichan;
137 Index ipol;
138
139 int logarithmic;
140
141 int plot_ebox;
142 float peak_zoom;
143 bool peak_centre_origin;
144 float baseline_zoom;
145 unsigned original_nchan;
146
147 float crop;
148
149 Reference::To<InfoLabel> info_label;
151
152 void plot_selection ();
153
154 };
155
156}
157
158#endif
The primary interface to pulsar observational data.
Definition Archive.h:46
FluxPlot()
Default constructor.
Definition FluxPlot.C:27
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
The primary interface to pulsar observational data.
Definition Archive.h:46
const ProfileVectorPlotter * get_plotter() const
Provide limited access to the plotter.
Definition FluxPlot.h:120
void set_pol(Index _ipol)
Set the polarization to plot.
Definition FluxPlot.h:77
virtual float get_flux_error(const Profile *data)
Compute the error in flux.
Definition FluxPlot.C:379
void set_baseline_zoom(float zoom)
Automatically zoom in on the baseline.
Definition FluxPlot.h:89
~FluxPlot()
Destructor.
Definition FluxPlot.C:45
void plot_profile(const Profile *)
Draw a profile in the currently open window.
Definition FluxPlot.C:255
void prepare(const Archive *)
Perform any preprocessing steps.
Definition FluxPlot.C:64
FluxPlot()
Default constructor.
Definition FluxPlot.C:27
void set_plot_histogram(bool f=true)
Plot an error box on the baseline.
Definition FluxPlot.h:101
void set_chan(Index _ichan)
Set the frequency channel to plot (where applicable)
Definition FluxPlot.h:73
virtual void get_profiles(const Archive *)=0
Derived classes must provide the profiles.
void set_crop(float new_crop)
Set the crop fraction.
Definition FluxPlot.h:126
void set_info_label(bool flag=true)
Use an informative label above the plot.
Definition FluxPlot.C:455
virtual float get_phase_error(const Archive *data)
Compute the error in phase.
Definition FluxPlot.C:328
TextInterface::Parser * get_interface()
Return the text interface.
Definition FluxPlot.C:49
void draw(const Archive *)
Draw the profiles in the currently open window.
Definition FluxPlot.C:174
virtual void auto_scale_phase(const Profile *data, float buffer)
Automatically scale in on the on-pulse region.
Definition FluxPlot.C:275
void set_plot_error_box(int code)
Plot an error box on the baseline.
Definition FluxPlot.h:97
virtual float get_flux_maximum(const Profile *data)
Compute the maximum flux.
Definition FluxPlot.C:55
void set_selection(const PhaseWeight *)
Set the selected profiles.
Definition FluxPlot.C:249
float get_crop() const
Get the crop level.
Definition FluxPlot.h:129
void set_logarithmic(int val)
Plot on a logarithmic scale, normalized by noise.
Definition FluxPlot.h:81
void set_subint(Index _isubint)
Set the sub-integration to plot (where applicable)
Definition FluxPlot.h:69
void set_original_nchan(unsigned nchan)
Set the original number of frequency channels.
Definition FluxPlot.h:107
std::string get_ylabel(const Archive *)
Get the default label for the y axis.
Definition FluxPlot.C:316
virtual void plot_error_box(const Archive *data)
Draw the error box.
Definition FluxPlot.C:392
void set_peak_zoom(float zoom)
Automatically zoom in on the pulse peak.
Definition FluxPlot.h:85
Combines an index value and integrate flag.
Definition Index.h:19
Print a label with three rows above the plot frame.
Definition InfoLabel.h:23
PhasePlot()
Default constructor.
Definition PhasePlot.C:11
Stores a weight for each Profile phase bin.
Definition PhaseWeight.h:24
Plots flux profiles.
Definition ProfileVectorPlotter.h:22
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0