AnglePlot.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/AnglePlot.h
10 
11 #ifndef __Pulsar_AnglePlot_h
12 #define __Pulsar_AnglePlot_h
13 
14 #include "Pulsar/PhasePlot.h"
15 #include "Pulsar/Index.h"
16 
17 #include "Functor.h"
18 #include "Estimate.h"
19 
20 namespace Pulsar {
21 
23  class AnglePlot : public PhasePlot {
24 
25  public:
26 
27  enum Marker { ErrorTick=0x01, ErrorBar=0x02, Dot=0x04 };
28 
30  AnglePlot ();
31 
34 
35  // Text interface to the AnglePlot class
36  class Interface : public TextInterface::To<AnglePlot> {
37  public:
38  Interface (AnglePlot* = 0);
39  };
40 
42  virtual void get_angles (const Archive*) = 0;
43 
45  void prepare (const Archive*);
46 
48  void draw (const Archive*);
49 
50  std::string get_flux_label (const Archive* data);
51 
53  void set_subint (const Index& _isubint) { isubint = _isubint; }
54  Index get_subint () const { return isubint; }
55 
57  void set_chan (const Index& _ichan) { ichan = _ichan; }
58  Index get_chan () const { return ichan; }
59 
61  void set_marker (Marker m) { marker = m; }
62  Marker get_marker () const { return marker; }
63 
65  void set_threshold (float t) { threshold = t; }
66  float get_threshold () const { return threshold; }
67 
69  void set_span (float t) { span = t; }
70  float get_span () const { return span; }
71 
72  Functor< float(float) > model;
73 
74  const std::vector< Estimate<double> >& get_angles () const
75  { return angles; }
76 
77  protected:
78 
80  Marker marker;
81 
83  float threshold;
84 
86  float span;
87 
89  std::vector< Estimate<double> > angles;
90 
91  Index ichan;
92  Index isubint;
93  };
94 
95  std::ostream& operator << (std::ostream& os, AnglePlot::Marker);
96  std::istream& operator >> (std::istream& is, AnglePlot::Marker&);
97 
98 }
99 
100 #endif
virtual double get_gate_duty_cycle() const
Get the fraction of the pulse period recorded (in turns)
Definition: Integration.h:220
float span
Span of values in degrees.
Definition: AnglePlot.h:96
Combines an index value and integrate flag.
Definition: Index.h:24
The primary interface to pulsar observational data.
Definition: Archive.h:45
std::vector< Estimate< double > > angles
The angles.
Definition: AnglePlot.h:99
float threshold
Noise threshold.
Definition: AnglePlot.h:93
virtual void get_angles(const Archive *)=0
Derived types compute the angles to be plotted.
TextInterface::Parser * get_interface()
Get the text interface to the configuration attributes.
Definition: AnglePlot.C:32
Integration * get_Integration(unsigned subint)
Return pointer to the specified Integration.
Definition: IntegrationManager.C:41
void set_threshold(float t)
will draw only those points with linear > threshold * sigma
Definition: AnglePlot.h:75
AnglePlot()
Default constructor.
Definition: AnglePlot.C:22
Plots an angle and its error as a function of pulse phase.
Definition: AnglePlot.h:28
T get_value() const
Marker marker
Marker used to plot each point.
Definition: AnglePlot.h:90
std::string get_flux_label(const Archive *data)
Return the label for the y-axis.
Definition: AnglePlot.C:208
void set_marker(Marker m)
the mark to be used
Definition: AnglePlot.h:71
void set_subint(const Index &_isubint)
Set the sub-integration to plot (where applicable)
Definition: AnglePlot.h:63
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void prepare(const Archive *)
return the minimum and maximum value in degrees
Definition: AnglePlot.C:37
virtual unsigned get_nbin() const =0
Get the number of pulsar phase bins used.
void draw(const Archive *)
draw the angle as a function of pulse phase
Definition: AnglePlot.C:95
void set_span(float t)
span of value in degrees
Definition: AnglePlot.h:79
void set_chan(const Index &_ichan)
Set the frequency channel to plot (where applicable)
Definition: AnglePlot.h:67

Generated using doxygen 1.8.17