IterativeBaseline.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/IterativeBaseline.h
10 
11 #ifndef __Pulsar_IterativeBaseline_h
12 #define __Pulsar_IterativeBaseline_h
13 
14 #include "Pulsar/BaselineEstimator.h"
15 
16 namespace Pulsar {
17 
18  class PhaseWeightSmooth;
19 
21  class IterativeBaseline : public BaselineEstimator {
22 
23  public:
24 
27 
30 
33  BaselineEstimator* get_initial_baseline () const;
34 
36  virtual void set_threshold (float sigma);
37  float get_threshold () const { return threshold; }
38 
40  void set_max_iterations (unsigned iterations);
41 
42  void set_run_postprocessing (bool f) { run_postprocessing = false; }
43  bool get_run_postprocessing () const { return run_postprocessing; }
44 
45  protected:
46 
48  void calculate (PhaseWeight* weight);
49 
51  virtual void get_bounds (PhaseWeight*, float& lower, float& upper) = 0;
52 
53  virtual void postprocess (PhaseWeight* weight, const Profile* profile);
54 
56  float threshold;
57 
59  unsigned max_iterations;
60 
62  bool run_postprocessing;
63 
66 
68  bool get_initial_bounds () const { return initial_bounds; }
69 
70  private:
71 
73  bool initial_bounds;
74 
75  };
76 
77 }
78 
79 #endif
unsigned max_iterations
The maximum number of iterations.
Definition: IterativeBaseline.h:64
Reference::To< BaselineEstimator > initial_baseline
The BaselineEstimator used to find the initial baseline.
Definition: IterativeBaseline.h:70
void calculate(PhaseWeight *weight)
Calculate the PhaseWeight.
Definition: IterativeBaseline.C:70
virtual void get_bounds(PhaseWeight *, float &lower, float &upper)=0
Derived classes must define the bounds.
void set_max_iterations(unsigned iterations)
Set the maximum number of iterations.
Definition: IterativeBaseline.C:59
~IterativeBaseline()
Destructor.
Definition: IterativeBaseline.C:34
virtual void set_threshold(float sigma)
Set the threshold below which samples are included in the baseline.
Definition: IterativeBaseline.C:49
IterativeBaseline()
Default constructor.
Definition: IterativeBaseline.C:25
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
Reference::To< const Profile, false > profile
The Profile from which the PhaseWeight will be derived.
Definition: ProfileWeightFunction.h:61
Finds the phase window in which the smoothed Profile is an extremum.
Definition: BaselineWindow.h:28
T get_value() const
void set_initial_baseline(BaselineEstimator *)
Set the BaselineEstimator used to find the initial baseline.
Definition: IterativeBaseline.C:38
bool get_initial_bounds() const
Provide access to derived classes.
Definition: IterativeBaseline.h:73
float threshold
The threshold below which samples are included in the baseline.
Definition: IterativeBaseline.h:61
Defines the PSRCHIVE library.
Definition: CalSource.h:17
ProfileWeight algorithms that compute profile baselines.
Definition: BaselineEstimator.h:24
Converts elements without equal neighbours to another state.
Definition: ConvertIsolated.h:26
bool run_postprocessing
Run the postprocessing algorithm.
Definition: IterativeBaseline.h:67

Generated using doxygen 1.8.17