RemoveBaseline.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2009 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/RemoveBaseline.h
10 
11 #ifndef _Pulsar_RemoveBaseline_H
12 #define _Pulsar_RemoveBaseline_H
13 
14 #include "Pulsar/Transformation.h"
15 #include "Pulsar/Archive.h"
16 
17 namespace Pulsar
18 {
20  class RemoveBaseline : public Transformation<Archive>
21  {
22  public:
23 
24  RemoveBaseline ();
25 
26  /* Two simple baseline removal algorithms
27  (Not every child of RemoveBaseline needs to be nested.) */
28 
29  class Total;
30  class Each;
31 
33 
37  class Operation : public Reference::Able
38  {
39  public:
40  static Operation* factory (const std::string&);
41 
42  virtual void operate (Profile*, const PhaseWeight*) = 0;
43  };
44 
45  /* Some simple baseline removal operations
46  (Not every child of RemoveBaseline::Operation needs to be nested.) */
47 
48  class SubtractMean;
49  class SubtractMedian;
50  class NormalizeByMean;
51  class NormalizeByMedian;
52  class NormalizeByStdDev;
53  class NormalizeByMedAbsDif;
54 
55  void set_operation (Operation*);
56 
57  protected:
58  Reference::To<Operation> profile_operation;
59  };
60 
62 
66  {
67  public:
68 
70  void transform (Archive*);
71 
73  void operate (Integration*, const PhaseWeight*);
74  };
75 
77 
81  {
82  public:
83 
85  void transform (Archive*);
86  };
87 
88  class RemoveBaseline::SubtractMean
90  {
91  public:
92  virtual void operate (Profile*, const PhaseWeight*);
93  };
94 
95  class RemoveBaseline::SubtractMedian
97  {
98  public:
99  virtual void operate (Profile*, const PhaseWeight*);
100  };
101 
102  class RemoveBaseline::NormalizeByMean
103  : public RemoveBaseline::Operation
104  {
105  public:
106  virtual void operate (Profile*, const PhaseWeight*);
107  };
108 
109  class RemoveBaseline::NormalizeByMedian
110  : public RemoveBaseline::Operation
111  {
112  public:
113  virtual void operate (Profile*, const PhaseWeight*);
114  };
115 
116  class RemoveBaseline::NormalizeByStdDev
117  : public RemoveBaseline::Operation
118  {
119  public:
120  virtual void operate (Profile*, const PhaseWeight*);
121  };
122 
123  class RemoveBaseline::NormalizeByMedAbsDif
124  : public RemoveBaseline::Operation
125  {
126  public:
127  virtual void operate (Profile*, const PhaseWeight*);
128  };
129 
130 
131 }
132 
133 #endif
134 
virtual unsigned get_npol() const =0
Get the number of polarization measurements.
Combines an index value and integrate flag.
Definition: Index.h:24
Performs the baseline removal operation.
Definition: RemoveBaseline.h:47
const Integration * get_Integration(const Archive *data, Index subint)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:118
Stores a weight for each Profile phase bin.
Definition: PhaseWeight.h:29
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
The primary interface to pulsar observational data.
Definition: Archive.h:45
Pulsar::Phase phase(const MJD &t) const
Type * get() const
Definition: MoreProfiles.h:24
void transform(Archive *)
Remove the baseline.
Definition: RemoveBaseline.C:81
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
double period(const MJD &t) const
Find the baseline from the total integrated total intensity profile.
Definition: RemoveBaseline.h:70
Find the baseline from each total intensity profile.
Definition: RemoveBaseline.h:85
void operate(Integration *, const PhaseWeight *)
Remove the baseline.
Definition: RemoveBaseline.C:44
void transform(Archive *)
Remove the baseline.
Definition: RemoveBaseline.C:31
virtual unsigned get_nchan() const =0
Get the number of chans.
Algorithms that remove the off-pulse baseline.
Definition: RemoveBaseline.h:25
Shift phase weight mask by dispersion delay.
Definition: DisperseWeight.h:30
Defines the PSRCHIVE library.
Definition: CalSource.h:17
const Profile * get_Profile(const Archive *data, Index subint, Index pol, Index chan)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:24
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
virtual Profile * get_Profile(unsigned i)
get the ith Profile
Definition: MoreProfiles.C:57
virtual unsigned get_size() const
get the size of the profile vector
Definition: MoreProfiles.C:44
void set_Profile(const Profile *profile) const
Set the Profile from which statistics are calculated.
Definition: PhaseWeight.C:303

Generated using doxygen 1.8.17