BaselineWindow.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2005 - 2016 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/BaselineWindow.h
10 
11 #ifndef __Pulsar_BaselineWindow_h
12 #define __Pulsar_BaselineWindow_h
13 
14 #include "Pulsar/BaselineEstimator.h"
15 #include "PhaseRange.h"
16 
17 namespace Pulsar {
18 
19  class Profile;
20  class Smooth;
21 
23  class BaselineWindow : public BaselineEstimator
24  {
25 
26  public:
27 
29  BaselineWindow ();
30 
33 
35  void set_smooth (Smooth*);
36 
38  Smooth* get_smooth () const;
39 
41  void set_find_minimum (bool f = true);
42  bool get_find_minimum () const;
43 
45  void set_find_maximum (bool f = true);
46  bool get_find_maximum () const;
47 
49  void set_find_mean (float mean);
50  float get_find_mean () const;
51 
53  void set_range (int bin_start, int bin_end);
54 
56  void set_search_range (const Phase::Range&);
57 
60 
63 
65  float find_phase (const std::vector<float>& amps);
66 
68  float find_phase (unsigned nbin, const float* amps);
69 
72 
74  class Interface;
75 
77  BaselineWindow* clone () const;
78 
79  protected:
80 
82  void calculate (PhaseWeight* weight);
83 
86 
88  bool find_max;
89 
91  bool find_mean;
92 
94  float mean;
95 
98  Phase::Range found_range;
99 
101  bool range_specified;
102  };
103 
104 }
105 
106 
107 #endif // !defined __Pulsar_BaselineWindow_h
Reference::To< Smooth > smooth
The smoothing function.
Definition: BaselineWindow.h:90
bool find_mean
Set true when algorithm finds mean.
Definition: BaselineWindow.h:96
Smooth * get_smooth() const
Get the smoothing function.
Definition: BaselineWindow.C:77
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
BaselineWindow()
Default constructor.
Definition: BaselineWindow.C:25
float mean
Mean value to be found.
Definition: BaselineWindow.h:99
void set_find_minimum(bool f=true)
Set to find the minimum mean.
Definition: BaselineWindow.C:123
void set_amps(const T *data)
set the amplitudes array equal to the contents of the data array
Definition: ProfileAmps.h:89
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
Phase::Range search_range
The first bin in the selected range.
Definition: BaselineWindow.h:102
Phase::Range get_search_range() const
Get the range to be search.
Definition: BaselineWindow.C:174
void calculate(PhaseWeight *weight)
Calculate the PhaseWeight.
Definition: BaselineWindow.C:90
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: BaselineWindow.C:320
Finds the phase window in which the smoothed Profile is an extremum.
Definition: BaselineWindow.h:28
void set_find_maximum(bool f=true)
Set to find the maximum mean.
Definition: BaselineWindow.C:135
Profile smoothing algorithms.
Definition: Smooth.h:28
bool range_specified
Set true when range is specified.
Definition: BaselineWindow.h:106
float find_phase(const std::vector< float > &amps)
Return the phase at which minimum or maximum mean is found.
Definition: BaselineWindow.C:187
void set_find_mean(float mean)
Set to find the mean closest to the specified value.
Definition: BaselineWindow.C:145
void set_search_range(const Phase::Range &)
Set the range to be searched.
Definition: BaselineWindow.C:167
Defines the PSRCHIVE library.
Definition: CalSource.h:17
BaselineWindow * clone() const
Return a copy constructed instance of self.
Definition: BaselineWindow.C:54
Phase::Range get_found_range() const
Get the range found during execution.
Definition: BaselineWindow.C:180
void set_smooth(Smooth *)
Set the smoothing function.
Definition: BaselineWindow.C:60
void set_range(int bin_start, int bin_end)
Set the start and end bins of the search.
Definition: BaselineWindow.C:157
bool find_max
Set true when algorithm finds max.
Definition: BaselineWindow.h:93

Generated using doxygen 1.8.17