CoherentDedispersion.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2010 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Extensions/Pulsar/CoherentDedispersion.h
10 
11 #ifndef __CoherentDedispersion_h
12 #define __CoherentDedispersion_h
13 
14 #include "Pulsar/ArchiveExtension.h"
15 
16 namespace Pulsar {
17 
19 
22  class CoherentDedispersion : public Pulsar::Archive::Extension {
23 
24  public:
25 
28 
30  CoherentDedispersion* clone () const;
31 
34 
35  // Text interface to a CoherentDedispersion instance
36  class Interface : public TextInterface::To<CoherentDedispersion>
37  {
38  public:
39  Interface( CoherentDedispersion* = NULL );
40  };
41 
43  std::string get_short_name () const { return "cd"; }
44 
46  //
47  // OutputChannel nested class
48  //
50 
52  class OutputChannel
53  {
54 
55  public:
56 
58  double get_centre_frequency () const { return centre_frequency; }
60  void set_centre_frequency (double val) { centre_frequency = val; }
61 
63  double get_bandwidth () const { return bandwidth; }
65  void set_bandwidth (double val) { bandwidth = val; }
66 
68  unsigned get_nsamp () const { return nsamp; }
70  void set_nsamp (unsigned val) { nsamp = val; }
71 
73  unsigned get_nsamp_overlap_pos () const { return nsamp_overlap_pos; }
75  void set_nsamp_overlap_pos (unsigned val) { nsamp_overlap_pos = val; }
76 
78  unsigned get_nsamp_overlap_neg () const { return nsamp_overlap_neg; }
80  void set_nsamp_overlap_neg (unsigned val) { nsamp_overlap_neg = val; }
81 
82  protected:
83 
86 
88  double bandwidth;
89 
91  unsigned nsamp;
92 
94  unsigned nsamp_overlap_pos;
95 
97  unsigned nsamp_overlap_neg;
98 
99  };
100 
102  //
103  // InputChannel nested class
104  //
106 
108  class InputChannel
109  {
110 
111  public:
112 
114  double get_centre_frequency () const { return centre_frequency; }
116  void set_centre_frequency (double val) { centre_frequency = val; }
117 
119  double get_bandwidth () const { return bandwidth; }
121  void set_bandwidth (double val) { bandwidth = val; }
122 
124  unsigned get_nchan_output () const { return output.size(); }
125  void set_nchan_output (unsigned nchan) { output.resize( nchan ); }
126 
127  const OutputChannel& get_output (unsigned ichan_output) const;
128  OutputChannel& get_output (unsigned ichan_output);
129 
130  protected:
131 
133  double centre_frequency;
134 
136  double bandwidth;
137 
139  std::vector<OutputChannel> output;
140 
141  void check_index (unsigned ichan_output) const;
142  };
143 
145  //
146  // CoherentDedisperion class attributes/methods
147  //
149 
151  Signal::Dimension get_domain () const { return domain; }
152  void set_domain (Signal::Dimension val) { domain = val; }
153 
155  std::string get_description () const { return description; }
156  void set_description (const std::string& val) { description = val; }
157 
159  double get_dispersion_measure () const { return dispersion_measure; }
160  void set_dispersion_measure (double val) { dispersion_measure = val; }
161 
163  double get_doppler_correction () const { return doppler_correction; }
164  void set_doppler_correction (double val) { doppler_correction = val; }
165 
167  int get_nbit_data () const { return nbit_data; }
168  void set_nbit_data (int nbit) { nbit_data = nbit; }
169 
171  int get_nbit_chirp () const { return nbit_chirp; }
172  void set_nbit_chirp (int nbit) { nbit_chirp = nbit; }
173 
175  unsigned get_nchan_input () const { return input.size(); }
176  void set_nchan_input (unsigned nchan) { input.resize( nchan ); }
177 
178  const InputChannel& get_input (unsigned ichan_input) const;
179  InputChannel& get_input (unsigned ichan_input);
180 
181  protected:
182 
185 
187  std::string description;
188 
190  double dispersion_measure;
191 
193  double doppler_correction;
194 
196  int nbit_data;
197 
199  int nbit_chirp;
200 
202  std::vector<InputChannel> input;
203 
205  void check_index (unsigned ichan_input) const;
206  };
207 
208 }
209 
210 #endif
Signal::Dimension domain
Domain in which the algorithm operates (time or frequency)
Definition: CoherentDedispersion.h:194
void set_centre_frequency(double val)
Centre frequency of output channel.
Definition: CoherentDedispersion.h:70
Coherent dedispersion attributes specific to input frequency channel.
Definition: CoherentDedispersion.h:118
int nbit_chirp
Number of bits used to represent chirp.
Definition: CoherentDedispersion.h:209
std::vector< InputChannel > input
Information specific to each input frequency channel.
Definition: CoherentDedispersion.h:212
double get_bandwidth() const
Bandwidth of output channel.
Definition: CoherentDedispersion.h:73
double bandwidth
Bandwidth of output channel.
Definition: CoherentDedispersion.h:98
double get_dispersion_measure() const
Dispersion measure used for coherent dedispersion.
Definition: CoherentDedispersion.h:169
CoherentDedispersion()
Default constructor.
Definition: CoherentDedispersion.C:13
std::string get_short_name() const
Return a short name.
Definition: CoherentDedispersion.h:53
std::vector< OutputChannel > output
Information specific to each output frequency channel.
Definition: CoherentDedispersion.h:149
void set_bandwidth(double val)
Bandwidth of input channel.
Definition: CoherentDedispersion.h:131
unsigned get_nsamp_overlap_neg() const
Number of complex time samples in wrap-around region, right-hand side.
Definition: CoherentDedispersion.h:88
double get_centre_frequency() const
Centre frequency of input channel.
Definition: CoherentDedispersion.h:124
int get_nbit_data() const
Number of bits used to represent data.
Definition: CoherentDedispersion.h:177
int get_nbit_chirp() const
Number of bits used to represent chirp.
Definition: CoherentDedispersion.h:181
void set_nsamp_overlap_neg(unsigned val)
Number of complex time samples in wrap-around region, right-hand side.
Definition: CoherentDedispersion.h:90
double bandwidth
Bandwidth of input channel.
Definition: CoherentDedispersion.h:146
Coherent dedispersion attributes specific to output frequency channel.
Definition: CoherentDedispersion.h:62
double get_centre_frequency() const
Centre frequency of output channel.
Definition: CoherentDedispersion.h:68
Signal::Dimension get_domain() const
Domain in which the algorithm operates (time or frequency)
Definition: CoherentDedispersion.h:161
std::string get_description() const
Description of the algorithm.
Definition: CoherentDedispersion.h:165
TextInterface::Parser * get_interface()
get the text interface
Definition: CoherentDedispersion.C:33
Record of phase-coherent dispersion removal algorithm.
Definition: CoherentDedispersion.h:27
std::string description
Description of the algorithm.
Definition: CoherentDedispersion.h:197
double centre_frequency
Centre frequency of input channel.
Definition: CoherentDedispersion.h:143
double dispersion_measure
Dispersion measure used for coherent dedispersion.
Definition: CoherentDedispersion.h:200
unsigned get_nsamp() const
Number of complex time samples in each cyclical convolution.
Definition: CoherentDedispersion.h:78
double get_bandwidth() const
Bandwidth of input channel.
Definition: CoherentDedispersion.h:129
int nbit_data
Number of bits used to represent data.
Definition: CoherentDedispersion.h:206
double get_doppler_correction() const
Doppler shift correction applied to frequencies and bandwidths.
Definition: CoherentDedispersion.h:173
double doppler_correction
Doppler shift correction applied to frequencies and bandwidths.
Definition: CoherentDedispersion.h:203
void check_index(unsigned ichan_input) const
Throw an exception if index is out of range.
Definition: CoherentDedispersion.C:52
unsigned get_nchan_input() const
Number of frequency channels in the input signal.
Definition: CoherentDedispersion.h:185
unsigned get_nsamp_overlap_pos() const
Number of complex time samples in wrap-around region, left-hand side.
Definition: CoherentDedispersion.h:83
void set_nsamp_overlap_pos(unsigned val)
Number of complex time samples in wrap-around region, left-hand side.
Definition: CoherentDedispersion.h:85
void set_centre_frequency(double val)
Centre frequency of input channel.
Definition: CoherentDedispersion.h:126
CoherentDedispersion * clone() const
Clone method.
Definition: CoherentDedispersion.C:27
Definition: ArchiveExtension.h:28
Defines the PSRCHIVE library.
Definition: CalSource.h:17
double centre_frequency
Centre frequency of output channel.
Definition: CoherentDedispersion.h:95
unsigned nsamp
Number of complex time samples in each cyclical convolution.
Definition: CoherentDedispersion.h:101
unsigned get_nchan_output() const
Number of frequency channels into which this channel was divided.
Definition: CoherentDedispersion.h:134
void set_bandwidth(double val)
Bandwidth of output channel.
Definition: CoherentDedispersion.h:75
unsigned nsamp_overlap_pos
Number of complex time samples in wrap-around region, left-hand side.
Definition: CoherentDedispersion.h:104
void set_nsamp(unsigned val)
Number of complex time samples in each cyclical convolution.
Definition: CoherentDedispersion.h:80
unsigned nsamp_overlap_neg
Number of complex time samples in wrap-around region, right-hand side.
Definition: CoherentDedispersion.h:107

Generated using doxygen 1.8.17