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#include "Pulsar/HasBaselineEstimator.h"
16
17namespace Pulsar {
18
20
22
26
28 {
29
30 public:
31
34
36 void set_Profile (const Profile*);
37
39 void set_threshold (float threshold);
40
42 float get_threshold () const;
43
45 void set_consecutive (unsigned consecutive);
46
48 unsigned get_consecutive () const;
49
52
54 void set_range (int bin_start, int bin_end);
55
57 void get_indeces (int& rise, int& fall) const;
58
61
63 class Interface;
64
66 PeakConsecutive* clone () const;
67
68 protected:
69
71 void calculate (PhaseWeight* weight);
72
74 void build ();
75
78
80 bool built;
81
83 float threshold;
84
86 unsigned consecutive;
87
90
93
96
97 int bin_rise;
98 int bin_fall;
99
100 std::vector<unsigned> on_transitions;
101 std::vector<unsigned> off_transitions;
102 };
103
104}
105
106void regions( unsigned ndat, const float* data,
107 unsigned istart, unsigned istop,
108 unsigned region_size, float cutoff,
109 std::vector<unsigned>& on_transitions,
110 std::vector<unsigned>& off_transitions );
111
112#endif // !defined __Pulsar_PeakConsecutive_h
PeakConsecutive()
Default constructor.
Definition PeakConsecutive.C:25
int bin_start
The first bin in the selected range.
Definition PeakConsecutive.h:89
int bin_end
The last bin in the selected range.
Definition PeakConsecutive.h:92
float threshold
The threshold.
Definition PeakConsecutive.h:83
unsigned consecutive
The number of bins that must remain above threshold.
Definition PeakConsecutive.h:86
ProfileWeight algorithms that compute profile baselines.
Definition BaselineEstimator.h:19
HasBaselineEstimator()
Default constructor.
Definition HasBaselineEstimator.C:15
void get_indeces(int &rise, int &fall) const
Get the pulse phase bin indeces of the rise and fall.
Definition PeakConsecutive.C:258
float get_threshold() const
Get the threshold.
Definition PeakConsecutive.C:58
bool built
Flag set when the rise and fall are computed.
Definition PeakConsecutive.h:80
PeakConsecutive()
Default constructor.
Definition PeakConsecutive.C:25
bool merge_regions
Merge all on pulse regions into one.
Definition PeakConsecutive.h:77
void set_Profile(const Profile *)
Set the profile from which the rise and fall will be computed.
Definition PeakConsecutive.C:44
bool range_specified
Set true when range is specified.
Definition PeakConsecutive.h:95
void set_range(int bin_start, int bin_end)
Set the start and end bins of the search.
Definition PeakConsecutive.C:85
int bin_start
The first bin in the selected range.
Definition PeakConsecutive.h:89
int bin_end
The last bin in the selected range.
Definition PeakConsecutive.h:92
void calculate(PhaseWeight *weight)
Set the weights between rise and fall, or each rise/fall pair.
Definition PeakConsecutive.C:268
void set_baseline_estimator(ProfileWeightFunction *) override
Set the BaselineEstimator used to find the off-pulse phase bins.
Definition PeakConsecutive.C:78
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition PeakConsecutive.C:320
float threshold
The threshold.
Definition PeakConsecutive.h:83
unsigned get_consecutive() const
Get the consecutive.
Definition PeakConsecutive.C:72
void set_threshold(float threshold)
Set the threshold.
Definition PeakConsecutive.C:51
void build()
Compute the rise and fall of the pulse.
Definition PeakConsecutive.C:181
PeakConsecutive * clone() const
Return new copy of self.
Definition PeakConsecutive.C:39
unsigned consecutive
The number of bins that must remain above threshold.
Definition PeakConsecutive.h:86
void set_consecutive(unsigned consecutive)
Set the consecutive.
Definition PeakConsecutive.C:64
ProfileWeightFunction()
Default constructor.
Definition ProfileWeightFunction.C:15
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
Estimates the on-pulse region between a rise and a fall.
Definition RiseFall.h:19
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0