StokesCovariancePlot.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2014 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Plotting/Pulsar/StokesCovariancePlot.h
10 
11 #ifndef __Pulsar_StokesCovariancePlot_h
12 #define __Pulsar_StokesCovariancePlot_h
13 
14 #include "Pulsar/FluxPlot.h"
15 
16 namespace Pulsar {
17 
19  class StokesCovariancePlot : public FluxPlot {
20 
21  public:
22 
25 
28 
29  // Text interface to the StokesCovariancePlot class
30  class Interface : public TextInterface::To<StokesCovariancePlot> {
31  public:
32  Interface (StokesCovariancePlot* = 0);
33  };
34 
36  void get_profiles (const Archive* data);
37 
38  enum What { Variances,
39  EigenValues,
40  NaturalCovariances,
41  NonOrthogonality,
42  Theta,
43  RegressionCoefficients,
44  ModulationIndex,
45  DegreeOfPolarization};
46 
47  void set_what (What w) { what = w; }
48  What get_what () const { return what; }
49 
51  void set_plot_colours (const std::string& plot) { plot_colours = plot; }
52  std::string get_plot_colours () const { return plot_colours; }
53 
55  void set_plot_lines (const std::string& plot) { plot_lines = plot; }
56  std::string get_plot_lines () const { return plot_lines; }
57 
59  void set_plot_widths (const std::string& plot) { plot_widths = plot; }
60  std::string get_plot_widths () const { return plot_widths; }
61 
63  void set_std_deviations (bool flag) { plot_std_deviations = flag; }
64  bool get_std_deviations () const { return plot_std_deviations; }
65 
67  void set_remove_eigen_baseline (bool flag) { remove_eigen_baseline = flag; }
68  bool get_remove_eigen_baseline () const { return remove_eigen_baseline; }
69 
70  private:
71 
72  What what;
73 
74  std::string plot_colours;
75  std::string plot_lines;
76 
77  std::string plot_widths;
78 
79  bool plot_std_deviations;
80  bool remove_eigen_baseline;
81  };
82 
83  std::ostream& operator << (std::ostream& os, StokesCovariancePlot::What);
84 
85  std::istream& operator >> (std::istream& is, StokesCovariancePlot::What&);
86 }
87 
88 #endif
void stats(const Profile *profile, double *mean, double *variance=0, double *varmean=0, double *varvar=0) const
Get the statistics of the weighted phase bins (deprecated interface)
Definition: PhaseWeight.C:420
void set_remove_eigen_baseline(bool flag)
Remove the baseline from eigenvalue plots.
Definition: StokesCovariancePlot.h:77
const PolnProfile * get_Stokes(const Archive *data, Index subint, Index chan)
Return a new PolnProfile with state == Signal::Stokes.
Definition: Index.C:158
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
void get_profiles(const Archive *data)
Load the profiles.
Definition: StokesCovariancePlot.C:40
void set_plot_lines(const std::string &plot)
Set the line style for each value plotted.
Definition: StokesCovariancePlot.h:65
const Integration * get_Integration(const Archive *data, Index subint)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:118
Stores a weight for each Profile phase bin.
Definition: PhaseWeight.h:29
TextInterface::Parser * get_interface()
Get the text interface to the configuration attributes.
Definition: StokesCovariancePlot.C:25
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
The primary interface to pulsar observational data.
Definition: Archive.h:45
Plots a polarization pulse profile.
Definition: StokesCovariancePlot.h:24
void set_plot_widths(const std::string &plot)
Set the line width for each value plotted.
Definition: StokesCovariancePlot.h:69
void set_std_deviations(bool flag)
Compute the square roots of variances and eigenvalues.
Definition: StokesCovariancePlot.h:73
Computes fourth-order moment pulse profile statistics.
Definition: FourthMomentStats.h:28
virtual void plot(const Archive *)
Plot in the current viewport.
Definition: SimplePlot.C:15
void set_plot_colours(const std::string &plot)
Set the colour for each value plotted.
Definition: StokesCovariancePlot.h:61
Defines the PSRCHIVE library.
Definition: CalSource.h:17
StokesCovariancePlot()
Default constructor.
Definition: StokesCovariancePlot.C:18
void square_root()
calculate the signed sqrt of the absolute value of each bin
Definition: Profile.C:381

Generated using doxygen 1.8.17