FrequencyIntegrate.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2005 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/General/Pulsar/FrequencyIntegrate.h
10
11#ifndef __Pulsar_FrequencyIntegrate_h
12#define __Pulsar_FrequencyIntegrate_h
13
14#include "Pulsar/Integrate.h"
15#include "Pulsar/EvenlySpaced.h"
16#include "Pulsar/EvenlyWeighted.h"
17#include "Pulsar/NonlinearlySpaced.h"
18
19#include "Pulsar/Integration.h"
20
21namespace Pulsar {
22
23 class Integration;
24
26
41 class FrequencyIntegrate : public Integrate<Integration> {
42
43 public:
44
47
49 void transform (Integration*);
50
52 void set_dedisperse (bool);
53 bool get_dedisperse () const;
54
56 void set_defaraday (bool flag);
57 bool get_defaraday () const;
58
60 class EvenlySpaced;
61
63 class EvenlyWeighted;
64
66 class WavelengthSquaredSpaced;
67
68 protected:
69
70 bool dedisperse;
71 bool defaraday;
72
73 };
74
75 class FrequencyIntegrate::EvenlySpaced :
76 public Integrate<Integration>::EvenlySpaced
77 {
78 unsigned get_size (const Integration* sub)
79 { return sub->get_nchan(); }
80 };
81
82 class FrequencyIntegrate::EvenlyWeighted :
83 public Integrate<Integration>::EvenlyWeighted
84 {
85 unsigned get_size (const Integration* sub)
86 { return sub->get_nchan(); }
87
88 double get_weight (const Integration* sub, unsigned ichan)
89 { return sub->get_weight (ichan); }
90 };
91
92 class FrequencyIntegrate::WavelengthSquaredSpaced :
93 public Integrate<Integration>::NonlinearlySpaced
94 {
95 unsigned get_size (const Integration* sub)
96 { return sub->get_nchan(); }
97
98 double get_value (const Integration* sub, unsigned ichan)
99 { double freq = sub->get_centre_frequency (ichan); return 1.0 / (freq*freq); }
100 };
101
102}
103
104#endif
double get_centre_frequency(unsigned ichan) const
Get the Profile centre frequency attribute of the given channel.
Definition Integration.C:365
virtual unsigned get_nchan() const =0
Get the number of chans.
float get_weight(unsigned ichan) const
Get the Profile weight attribute of the given channel.
Definition Integration.C:400
void set_defaraday(bool flag)
Correct Faraday rotation before integrating, if necessary.
Definition FrequencyIntegrate.C:37
FrequencyIntegrate()
Default constructor.
Definition FrequencyIntegrate.C:18
void transform(Integration *)
The frequency integration operation.
Definition FrequencyIntegrate.C:47
void set_dedisperse(bool)
Correct dispersion before integrating, if necessary.
Definition FrequencyIntegrate.C:26
Profile integration algorithms.
Definition Integrate.h:36
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
virtual unsigned get_nchan() const =0
Get the number of chans.
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0