StokesFluctPlot.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2006 - 2015 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Plotting/Pulsar/StokesFluctPlot.h
10 
11 #ifndef __Pulsar_StokesFluctPlot_h
12 #define __Pulsar_StokesFluctPlot_h
13 
14 #include "Pulsar/FluctPlot.h"
15 
16 namespace Pulsar {
17 
18  class Profile;
19 
21  class StokesFluctPlot : public FluctPlot {
22 
23  public:
24 
27 
30 
31  // Text interface to the StokesFluctPlot class
32  class Interface : public TextInterface::To<StokesFluctPlot> {
33  public:
34  Interface (StokesFluctPlot* = 0);
35  };
36 
38  void prepare (const Archive* data);
39 
41  void draw (const Archive*);
42 
44  std::string get_ylabel (const Archive*);
45 
47  void get_profiles (const Archive*);
48 
50  void set_plot_values (const std::string& plot) { plot_values = plot; }
51  std::string get_plot_values () const { return plot_values; }
52 
54  void set_signal_to_noise (const bool plot) { signal_to_noise = plot; }
55  bool get_signal_to_noise () const { return signal_to_noise; }
56 
58  void set_harmonic_outliers (const bool plot)
59  {
60  harmonic_outliers = plot;
61  if (harmonic_outliers)
62  signal_to_noise = false;
63  }
64  bool get_harmonic_outliers () const { return harmonic_outliers; }
65 
67  void set_plot_colours (const std::string& plot) { plot_colours = plot; }
68  std::string get_plot_colours () const { return plot_colours; }
69 
71  void set_plot_lines (const std::string& plot) { plot_lines = plot; }
72  std::string get_plot_lines () const { return plot_lines; }
73 
75  void set_plot_last_harmonic (bool p) { plot_last_harmonic = p; }
76  bool get_plot_last_harmonic () const { return plot_last_harmonic; }
77 
79  void set_plot_fluctuation_phase (bool p) { plot_fluctuation_phase = p; }
80  bool get_plot_fluctuation_phase () const { return plot_fluctuation_phase; }
81 
82  protected:
83 
84  bool plot_log;
85  bool signal_to_noise;
86  bool harmonic_outliers;
87 
88  std::string plot_values;
89  std::string plot_colours;
90  std::string plot_lines;
91 
92  bool plot_last_harmonic;
93  bool plot_fluctuation_phase;
94  unsigned last_harmonic;
95 
96  };
97 
98 }
99 
100 #endif
void set_signal_to_noise(const bool plot)
Signal-to-noise ratio on the y-axis.
Definition: StokesFluctPlot.h:59
void set_harmonic_outliers(const bool plot)
Plot the harmonic outliers.
Definition: StokesFluctPlot.h:63
const PolnProfile * get_Stokes(const Archive *data, Index subint, Index chan)
Return a new PolnProfile with state == Signal::Stokes.
Definition: Index.C:158
Combines an index value and integrate flag.
Definition: Index.h:24
TextInterface::Parser * get_interface()
Get the text interface to the configuration attributes.
Definition: StokesFluctPlot.C:56
void find(const Profile *, double rms)
Find the last significant bin.
Definition: LastSignificant.C:58
void get_profiles(const Archive *)
Return the fluctuation power spectra to be plotted.
Definition: StokesFluctPlot.C:190
void set_left(const std::string &label)
Set the label to be drawn to the left of the frame.
Definition: PlotLabel.h:47
PlotLabel * get_label_below()
Get the below-frame label.
Definition: PlotFrame.h:74
PlotAxis * get_y_axis(bool allow_transpose)
Get the y-axis.
Definition: PlotFrame.C:228
std::string get_left() const
Get the label to be drawn to the left of the frame.
Definition: PlotLabel.h:49
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
void set_plot_last_harmonic(bool p)
Plot the last significant harmonic.
Definition: StokesFluctPlot.h:80
Stores three labels: left, centre, and right.
Definition: PlotLabel.h:27
void set_displacement(float d)
Set the label displacement from edge of viewport.
Definition: PlotAxis.h:50
const ScalarMath sqrt(const ScalarMath &x)
Type * release()
Commmon statistics that can be derived from a pulse profile.
Definition: ProfileStatistic.h:26
virtual Profile * clone() const
returns a pointer to a new copy of self
Definition: Profile.C:124
virtual double get(const Profile *)
Derived types define the value returned.
Definition: ProfileStatistic.C:27
Find the last significant harmonic in a PSD.
Definition: LastSignificant.h:29
std::string get_ylabel(const Archive *)
Get the default label for the y axis.
Definition: StokesFluctPlot.C:86
void set_plot_fluctuation_phase(bool p)
Plot the fluctuation phase.
Definition: StokesFluctPlot.h:84
Profile * fourier_transform(const Profile *, FTransform::Plan *=0)
Return the forward Fourier transform of the input Profile.
Definition: Fourier.C:41
Polarimetric pulse profile transformations and derivations.
Definition: PolnProfile.h:34
PlotScale * get_x_scale(bool allow_transpose)
Get the x-scale.
Definition: PlotFrame.C:189
PhaseWeight * baseline(const Profile *)
Returns a new PhaseWeight instance.
Definition: BaselineEstimator.C:73
void set_plot_lines(const std::string &plot)
Set the line style for each value plotted.
Definition: StokesFluctPlot.h:76
void prepare(const Archive *data)
Perform any preprocessing steps.
Definition: StokesFluctPlot.C:61
void set_plot_values(const std::string &plot)
Set the values to be plotted (one or more of I,Q,U,V,L,p)
Definition: StokesFluctPlot.h:55
StokesFluctPlot()
Default constructor.
Definition: StokesFluctPlot.C:25
Finds a baseline that contains gaussian white noise.
Definition: ExponentialBaseline.h:24
virtual void plot(const Archive *)
Plot in the current viewport.
Definition: SimplePlot.C:15
void detect(Profile *input)
Square-law detect the input complex-valued Profile.
Definition: Fourier.C:103
void set_plot_colours(const std::string &plot)
Set the colour for each value plotted.
Definition: StokesFluctPlot.h:72
void add_opt(char opt)
Add to the options to be passed to pgbox for this axis.
Definition: PlotAxis.C:22
Defines the PSRCHIVE library.
Definition: CalSource.h:17
const Profile * get_Profile(const Archive *data, Index subint, Index pol, Index chan)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:24
unsigned get() const
Get the last signficant bin.
Definition: LastSignificant.C:46
void set_right(const std::string &label)
Set the label to be drawn to the right of the frame.
Definition: PlotLabel.h:57
Plots fluctuation power spectra.
Definition: StokesFluctPlot.h:26
void invint(Profile *invint, bool second=true) const
Return the invariant interval.
Definition: PolnProfile.C:576
const Profile * get_Profile(unsigned ipol) const
Get the specifed constant profile.
Definition: PolnProfile.C:147
void draw(const Archive *)
Draw the profiles in the currently open window.
Definition: StokesFluctPlot.C:72
Stores the properties of the plot frame.
Definition: PlotFrame.h:31

Generated using doxygen 1.8.17