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
17namespace Pulsar {
18
19 class Profile;
20
22 class PowerSpectra : public FrequencyPlot {
23
24 public:
25
27 PowerSpectra ();
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
The primary interface to pulsar observational data.
Definition Archive.h:46
The primary interface to pulsar observational data.
Definition Archive.h:46
FrequencyPlot()
Default constructor.
Definition FrequencyPlot.C:9
Combines an index value and integrate flag.
Definition Index.h:19
void set_logarithmic(bool val)
Plot on a logarithmic scale.
Definition PowerSpectra.h:71
virtual void get_spectra(const Archive *)=0
Derived classes must provide the profiles.
void set_pol(const Index &_ipol)
Set the polarization to plot.
Definition PowerSpectra.h:52
std::string get_ylabel(const Archive *)
Get the default label for the y axis.
Definition PowerSpectra.C:230
PowerSpectra()
Default constructor.
Definition PowerSpectra.C:24
bool get_skip_zapped() const
Get skip zapped flag.
Definition PowerSpectra.h:68
TextInterface::Parser * get_interface()
Return the text interface.
Definition PowerSpectra.C:35
void set_skip_zapped(bool flag)
Set skip zapped flag.
Definition PowerSpectra.h:66
void draw(const Archive *)
Draw the spectra.
Definition PowerSpectra.C:113
bool get_draw_lines() const
Get draw lines flag.
Definition PowerSpectra.h:63
void set_subint(const Index &_isubint)
Set the sub-integration to plot (where applicable)
Definition PowerSpectra.h:48
void set_draw_lines(bool flag)
Set draw lines flag.
Definition PowerSpectra.h:61
void set_median_window(unsigned window)
Set the median filter window size.
Definition PowerSpectra.h:56
void prepare(const Archive *)
Perform any preprocessing steps.
Definition PowerSpectra.C:41
unsigned get_median_window() const
Get the median window size.
Definition PowerSpectra.h:58
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