WeightedFrequency.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2008 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/WeightedFrequency.h
10 
11 #ifndef __Pulsar_WeightedFrequency_h
12 #define __Pulsar_WeightedFrequency_h
13 
14 #include "Pulsar/Config.h"
15 
16 namespace Pulsar {
17 
18  class Archive;
19 
21  class WeightedFrequency
22  {
23 
24  public:
25 
27  class OverEpoch;
28 
30  class OverFrequency;
31 
33  virtual ~WeightedFrequency () { }
34 
36  double operator () (unsigned istart, unsigned iend) const;
37 
39  virtual unsigned get_nindex () const = 0;
40 
42  virtual double get_frequency (unsigned index) const = 0;
43 
45  virtual double get_weight (unsigned index) const = 0;
46 
48  static Option<bool> round_to_kHz;
49 
50  };
51 
52  class WeightedFrequency::OverEpoch : public WeightedFrequency
53  {
54  public:
55 
57  OverEpoch (const Archive*);
58 
60  void set_Archive (const Archive*);
61 
63  void set_ichan (unsigned ichan);
64 
66  unsigned get_nindex () const;
67 
69  double get_frequency (unsigned index) const;
70 
72  double get_weight (unsigned index) const;
73 
74  protected:
75 
77  unsigned ichan;
78  unsigned ipol;
79  };
80 
81  class Integration;
82 
83  class WeightedFrequency::OverFrequency : public WeightedFrequency
84  {
85  public:
86 
88  OverFrequency (const Integration*);
89 
91  void set_Integration (const Integration*);
92 
94  unsigned get_nindex () const;
95 
97  double get_frequency (unsigned index) const;
98 
100  double get_weight (unsigned index) const;
101 
102  protected:
103 
105  unsigned ipol;
106  };
107 
108 }
109 
110 #endif
Compute the weighted mean frequency.
Definition: WeightedFrequency.h:26
The primary interface to pulsar observational data.
Definition: Archive.h:45
virtual ~WeightedFrequency()
Destructor.
Definition: WeightedFrequency.h:38
double operator()(unsigned istart, unsigned iend) const
Return the weighted mean frequency.
Definition: WeightedFrequency.C:32
static Option< bool > round_to_kHz
Round the weighted frequency to the nearest kHz.
Definition: WeightedFrequency.h:53
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
Defines the PSRCHIVE library.
Definition: CalSource.h:17
virtual unsigned get_nindex() const =0
Get the number of frequencies available.
virtual double get_frequency(unsigned index) const =0
Get the frequency for the specified index.
virtual double get_weight(unsigned index) const =0
Get the weight for the specified index.

Generated using doxygen 1.8.17