PowerSpectra.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/PowerSpectra.h
10 
11 #ifndef __Pulsar_PowerSpectra_h
12 #define __Pulsar_PowerSpectra_h
13 
14 #include "Pulsar/FrequencyPlot.h"
15 #include "Pulsar/Index.h"
16 
17 namespace Pulsar {
18 
19  class Profile;
20 
22  class PowerSpectra : public FrequencyPlot {
23 
24  public:
25 
28 
31 
32  // Text interface to the PowerSpectra class
33  class Interface : public TextInterface::To<PowerSpectra> {
34  public:
35  Interface (PowerSpectra* = 0);
36  };
37 
39  void prepare (const Archive*);
40 
42  std::string get_ylabel (const Archive*);
43 
45  virtual void get_spectra (const Archive*) = 0;
46 
48  void set_subint (const Index& _isubint) { isubint = _isubint; }
49  Index get_subint () const { return isubint; }
50 
52  void set_pol (const Index& _ipol) { ipol = _ipol; }
53  Index get_pol () const { return ipol; }
54 
56  void set_median_window (unsigned window) { median_window = window; }
58  unsigned get_median_window () const { return median_window; }
59 
61  void set_draw_lines (bool flag) { draw_lines = flag; }
63  bool get_draw_lines () const { return draw_lines; }
64 
66  void set_skip_zapped (bool flag) { skip_zapped = flag; }
68  bool get_skip_zapped () const { return skip_zapped; }
69 
71  void set_logarithmic (bool val) { logarithmic = val; }
72  bool get_logarithmic () const { return logarithmic; }
73 
75  void draw (const Archive*);
76 
78  void draw (const std::vector<float>&) const;
79 
80  protected:
81 
82  std::vector< std::vector<float> > spectra;
83  std::vector< int > plot_sci;
84  std::vector< int > plot_sls;
85 
86  Index isubint;
87  Index ipol;
88 
89  unsigned median_window;
90  bool draw_lines;
91  bool skip_zapped;
92  bool logarithmic;
93 
94  private:
95 
96  std::vector<float> frequencies;
97 
98  };
99 
100 }
101 
102 #endif
void draw(const Archive *)
Draw the spectra.
Definition: PowerSpectra.C:113
Combines an index value and integrate flag.
Definition: Index.h:24
PowerSpectra()
Default constructor.
Definition: PowerSpectra.C:24
void prepare(const Archive *)
Perform any preprocessing steps.
Definition: PowerSpectra.C:41
void set_subint(const Index &_isubint)
Set the sub-integration to plot (where applicable)
Definition: PowerSpectra.h:53
bool get_draw_lines() const
Get draw lines flag.
Definition: PowerSpectra.h:68
virtual Signal::Scale get_scale() const =0
Get the scale in which flux density is measured.
virtual void get_spectra(const Archive *)=0
Derived classes must provide the profiles.
The primary interface to pulsar observational data.
Definition: Archive.h:45
PlotPen * get_pen()
Provide access to the Pen.
Definition: HasPen.h:36
void set_pol(const Index &_ipol)
Set the polarization to plot.
Definition: PowerSpectra.h:57
unsigned get_median_window() const
Get the median window size.
Definition: PowerSpectra.h:63
virtual unsigned get_nchan() const =0
Get the number of frequency channels used.
void set_draw_lines(bool flag)
Set draw lines flag.
Definition: PowerSpectra.h:66
void set_logarithmic(bool val)
Plot on a logarithmic scale.
Definition: PowerSpectra.h:76
void setup()
Set the plot line attributes.
Definition: PlotPen.C:24
Plots flux profiles.
Definition: PowerSpectra.h:27
Interface to objects that have a PlotPen.
Definition: HasPen.h:24
bool get_skip_zapped() const
Get skip zapped flag.
Definition: PowerSpectra.h:73
std::string get_ylabel(const Archive *)
Get the default label for the y axis.
Definition: PowerSpectra.C:230
TextInterface::Parser * get_interface()
Return the text interface.
Definition: PowerSpectra.C:35
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_median_window(unsigned window)
Set the median filter window size.
Definition: PowerSpectra.h:61
void set_skip_zapped(bool flag)
Set skip zapped flag.
Definition: PowerSpectra.h:71

Generated using doxygen 1.8.17