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 
21 namespace 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
bool range_checking_enabled
Container classes should check array indeces at the cost of performance.
Definition: Pulsar.C:10
void set_dedisperse(bool)
Correct dispersion before integrating, if necessary.
Definition: FrequencyIntegrate.C:26
void set_defaraday(bool flag)
Correct Faraday rotation before integrating, if necessary.
Definition: FrequencyIntegrate.C:37
virtual unsigned get_npol() const =0
Get the number of polarization measurements.
void defaraday(unsigned ichan, unsigned kchan, double f0)
Defaraday worker function.
Definition: IntegrationExpert.h:93
Expert * expert()
Provide access to the expert interface.
Definition: Integration.C:162
void set_centre_frequency(unsigned ichan, double frequency)
Set the Profile centre frequency attributes of the given channel.
Definition: Integration.C:372
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
void transform(Integration *)
The frequency integration operation.
Definition: FrequencyIntegrate.C:47
void dedisperse(unsigned ichan, unsigned kchan, double f0)
Dedispersion worker function.
Definition: IntegrationExpert.h:89
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
double get_effective_rotation_measure() const
Get the effective rotation measure that remains to be corrected.
Definition: Integration.C:549
Profile integration algorithms.
Definition: Integrate.h:41
void resize(unsigned npol=0, unsigned nchan=0, unsigned nbin=0)
Set the dimensions of the data container.
Definition: IntegrationExpert.h:61
double get_effective_dispersion_measure() const
Get the effective dispersion measure that remains to be corrected.
Definition: Integration.C:500
virtual unsigned get_nchan() const =0
Get the number of chans.
Defines the PSRCHIVE library.
Definition: CalSource.h:17
FrequencyIntegrate()
Default constructor.
Definition: FrequencyIntegrate.C:18
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
double weighted_frequency(unsigned ch_start=0, unsigned ch_end=0) const
Computes the weighted centre frequency of an interval of sub-channels.
Definition: Integration_weighted_frequency.C:20

Generated using doxygen 1.8.17