PeakConsecutive.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2007 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/PeakConsecutive.h
10 
11 #ifndef __Pulsar_PeakConsecutive_h
12 #define __Pulsar_PeakConsecutive_h
13 
14 #include "Pulsar/RiseFall.h"
15 
16 namespace Pulsar {
17 
18  class BaselineEstimator;
19 
21 
26  class PeakConsecutive : public RiseFall {
27 
28  public:
29 
32 
34  void set_Profile (const Profile*);
35 
37  void set_threshold (float threshold);
38 
40  float get_threshold () const;
41 
43  void set_consecutive (unsigned consecutive);
44 
46  unsigned get_consecutive () const;
47 
50 
54 
56  void set_range (int bin_start, int bin_end);
57 
59  void get_indeces (int& rise, int& fall) const;
60 
63 
65  class Interface;
66 
68  PeakConsecutive* clone () const;
69 
70  protected:
71 
73  void calculate (PhaseWeight* weight);
74 
76  void build ();
77 
79  bool merge_regions;
80 
82  bool built;
83 
85  float threshold;
86 
88  unsigned consecutive;
89 
91  int bin_start;
92 
94  int bin_end;
95 
97  bool range_specified;
98 
99  int bin_rise;
100  int bin_fall;
101 
102  std::vector<unsigned> on_transitions;
103  std::vector<unsigned> off_transitions;
104 
107 
108  };
109 
110 }
111 
112 void regions( unsigned ndat, const float* data,
113  unsigned istart, unsigned istop,
114  unsigned region_size, float cutoff,
115  std::vector<unsigned>& on_transitions,
116  std::vector<unsigned>& off_transitions );
117 
118 #endif // !defined __Pulsar_PeakConsecutive_h
bool merge_regions
Merge all on pulse regions into one.
Definition: PeakConsecutive.h:84
void set_consecutive(unsigned consecutive)
Set the consecutive.
Definition: PeakConsecutive.C:64
void set_baseline_estimator(BaselineEstimator *)
Set the BaselineEstimator used to find the off-pulse phase bins.
Definition: PeakConsecutive.C:78
void set_threshold(float threshold)
Set the threshold.
Definition: PeakConsecutive.C:51
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: PeakConsecutive.C:334
void set_Profile(const Profile *)
Set the profile from which the rise and fall will be computed.
Definition: PeakConsecutive.C:44
float get_threshold() const
Get the threshold.
Definition: PeakConsecutive.C:58
Stores a weight for each Profile phase bin.
Definition: PhaseWeight.h:29
void set_range(int bin_start, int bin_end)
Set the start and end bins of the search.
Definition: PeakConsecutive.C:98
PeakConsecutive()
Default constructor.
Definition: PeakConsecutive.C:25
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
void build()
Compute the rise and fall of the pulse.
Definition: PeakConsecutive.C:194
bool range_specified
Set true when range is specified.
Definition: PeakConsecutive.h:102
void calculate(PhaseWeight *weight)
Set the weights between rise and fall, or each rise/fall pair.
Definition: PeakConsecutive.C:282
Reference::To< BaselineEstimator > baseline_estimator
The BaselineEstimator used to find the off-pulse phase bins.
Definition: PeakConsecutive.h:111
unsigned consecutive
The number of bins that must remain above threshold.
Definition: PeakConsecutive.h:93
const BaselineEstimator * get_baseline_estimator() const
Get the BaselineEstimator used to find the off-pulse phase bins.
Definition: PeakConsecutive.C:86
int bin_end
The last bin in the selected range.
Definition: PeakConsecutive.h:99
Finds pulse defined by number of consecutive points above threshold.
Definition: PeakConsecutive.h:31
unsigned get_consecutive() const
Get the consecutive.
Definition: PeakConsecutive.C:72
T get_value() const
PeakConsecutive * clone() const
Return new copy of self.
Definition: PeakConsecutive.C:39
float threshold
The threshold.
Definition: PeakConsecutive.h:90
int bin_start
The first bin in the selected range.
Definition: PeakConsecutive.h:96
Defines the PSRCHIVE library.
Definition: CalSource.h:17
ProfileWeight algorithms that compute profile baselines.
Definition: BaselineEstimator.h:24
void get_indeces(int &rise, int &fall) const
Get the pulse phase bin indeces of the rise and fall.
Definition: PeakConsecutive.C:272
bool built
Flag set when the rise and fall are computed.
Definition: PeakConsecutive.h:87

Generated using doxygen 1.8.17