GaussianBaseline.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/GaussianBaseline.h
10 
11 #ifndef __Pulsar_GaussianBaseline_h
12 #define __Pulsar_GaussianBaseline_h
13 
14 #include "Pulsar/IterativeBaseline.h"
15 
16 namespace Pulsar {
17 
19 
65  class GaussianBaseline : public IterativeBaseline {
66 
67  public:
68 
71 
73  void set_threshold (float sigma);
74  float get_threshold () const { return threshold; }
75 
77  void set_smoothing (unsigned);
78 
80  float get_variance_correction () const { return moment_correction; }
81 
83  static double get_variance_correction (double sigma);
84 
87 
89  class Interface;
90 
92  GaussianBaseline* clone () const;
93 
94  protected:
95 
96  void get_bounds (PhaseWeight* weight, float& lower, float& upper);
97 
98  void postprocess (PhaseWeight* weight, const Profile* profile);
99 
101  float moment_correction;
102 
104  float last_mean;
105 
107  unsigned smooth_bins;
108 
109  };
110 
111 }
112 
113 #endif
GaussianBaseline * clone() const
Return a copy constructed instance of self.
Definition: GaussianBaseline.C:28
float get_variance_correction() const
Get the variance correction factor.
Definition: GaussianBaseline.h:90
void set_bins(float)
Set the width of the smoothing window in phase bins.
Definition: Smooth.C:39
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
double eval(double x)
Smooths a Profile using the mean over a boxcar.
Definition: SmoothMean.h:29
float moment_correction
Adjustment when computing variance of samples below threshold.
Definition: GaussianBaseline.h:111
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: GaussianBaseline.C:201
GaussianBaseline()
Default constructor.
Definition: GaussianBaseline.C:22
float last_mean
Last mean computed during get_bounds.
Definition: GaussianBaseline.h:114
void set_threshold(float sigma)
Set the threshold below which samples are included in the baseline.
Definition: GaussianBaseline.C:39
Reference::To< const Profile, false > profile
The Profile from which the PhaseWeight will be derived.
Definition: ProfileWeightFunction.h:61
Adaptively computes the baseline, assuming normally distributed noise.
Definition: GaussianBaseline.h:70
virtual double moment2(double x1, double x2)
void set_smoothing(unsigned)
Set the smoothing factor used during post processing.
Definition: GaussianBaseline.C:33
void init(const std::vector< double > &x, const std::vector< double > &y)
void get_bounds(PhaseWeight *weight, float &lower, float &upper)
Derived classes must define the bounds.
Definition: GaussianBaseline.C:56
static std::string get_runtime()
Return the name of the runtime directory.
Definition: Config.C:120
float threshold
The threshold below which samples are included in the baseline.
Definition: IterativeBaseline.h:61
Defines the PSRCHIVE library.
Definition: CalSource.h:17
unsigned smooth_bins
Smoothing factor used in postprocessing.
Definition: GaussianBaseline.h:117

Generated using doxygen 1.8.17