Find the edges of a pulse. More...

#include <PeakCumulative.h>

Inheritance diagram for Pulsar::PeakCumulative:
Pulsar::RiseFall Pulsar::OnPulseEstimator Pulsar::ProfileWeightFunction Pulsar::PhaseWeightFunction Pulsar::Algorithm Reference::Able Reference::HeapTracked

Public Member Functions

 PeakCumulative ()
 Default constructor.
 
void set_Profile (const Profile *)
 Set the profile from which the rise and fall will be computed.
 
void set_threshold (float threshold)
 Set the threshold. More...
 
float get_threshold () const
 Get the threshold.
 
void set_choose (bool choose)
 Set the choose.
 
bool get_choose () const
 Get the choose.
 
void set_baseline_estimator (BaselineEstimator *)
 Set the BaselineEstimator used to find the off-pulse phase bins.
 
const BaselineEstimatorget_baseline_estimator () const
 Get the BaselineEstimator used to find the off-pulse phase bins.
 
BaselineEstimatorget_baseline_estimator ()
 
void set_range (int bin_start, int bin_end)
 Set the start and end bins of the search.
 
void get_indeces (int &rise, int &fall) const
 Get the pulse phase bin indeces of the rise and fall. More...
 
TextInterface::Parserget_interface ()
 Return a text interface that can be used to configure this instance.
 
PeakCumulativeclone () const
 Return new copy of self.
 
- Public Member Functions inherited from Pulsar::RiseFall
virtual std::pair< int, int > get_rise_fall (const Profile *)
 Return the rise and fall as a pair.
 
- Public Member Functions inherited from Pulsar::ProfileWeightFunction
 ProfileWeightFunction ()
 Default constructor.
 
void set_include (PhaseWeight *include)
 Include only the specified phase bins for consideration.
 
void set_exclude (PhaseWeight *include)
 Exclude the specified phase bins from consideration.
 
bool consider (unsigned ibin) const
 Return true if the specified phase bin should be considered.
 
virtual void get_weight (PhaseWeight *weight)
 Returns a PhaseWeight with the Profile attribute set.
 
virtual PhaseWeightoperate (const Profile *)
 Convenience interface.
 
- Public Member Functions inherited from Reference::Able
 Able (const Able &)
 
Ableoperator= (const Able &)
 
unsigned get_reference_count () const
 
- Public Member Functions inherited from Reference::HeapTracked
 HeapTracked (const HeapTracked &)
 
HeapTrackedoperator= (const HeapTracked &)
 
bool __is_on_heap () const
 

Protected Member Functions

void build ()
 Compute the rise and fall of the pulse.
 
- Protected Member Functions inherited from Pulsar::RiseFall
void calculate (PhaseWeight *weight)
 Set the weights between rise and fall. More...
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 

Protected Attributes

bool built
 Flag set when the rise and fall are computed.
 
float threshold
 The threshold.
 
int bin_start
 The first bin in the selected range.
 
int bin_end
 The last bin in the selected range.
 
bool range_specified
 Set true when range is specified.
 
int bin_rise
 
int bin_fall
 
bool choose
 
Reference::To< BaselineEstimatorbaseline_estimator
 The BaselineEstimator used to find the off-pulse phase bins.
 
- Protected Attributes inherited from Pulsar::ProfileWeightFunction
Reference::To< const Profile, false > profile
 The Profile from which the PhaseWeight will be derived.
 
Reference::To< PhaseWeightinclude
 Included phase bins.
 
Reference::To< PhaseWeightexclude
 Excluded phase bins.
 

Additional Inherited Members

- Static Public Member Functions inherited from Pulsar::ProfileWeightFunction
static ProfileWeightFunctionfactory (const std::string &name_and_parse)
 Construct a new ProfileWeightFunction from a string.
 
- Static Public Member Functions inherited from Reference::Able
static size_t get_instance_count ()
 
- Static Public Member Functions inherited from Reference::HeapTracked
static void * operator new (size_t size, void *ptr=0)
 
static void operator delete (void *location, void *ptr)
 
static void operator delete (void *location)
 
static size_t get_heap_queue_size ()
 

Detailed Description

Find the edges of a pulse.

Finds the edges at which the cumulative power falls below a threshold for the last time (rise), and where it remains above another threshold for the last time (fall). The function is best-suited to detect the edges of a pulsar main peak.

The threshold attribute defines:

The profile baseline is first subtracted from each amplitude; therefore, this class makes use of a BaselineEstimator to find the off-pulse baseline. By default, this is the baseline estimator defined by Profile::baseline; an alternate estimator can be specified by calling set_baseline_estimator.

If the choose flag is set, then the search for the peak edges will be performed twice and the narrowest peak will be returned. On the second try, the search starts half way into the profile. If no edges are found, Profile::find_max_phase is called with a duty cycle of 0.4 in order to find the "peak". In this case, rise and fall are set to reflect the phase of peak-0.2 and peak+0.2, respectively.

If the choose flag is false, then the first peaks found will be returned.

Member Function Documentation

◆ get_indeces()

void Pulsar::PeakCumulative::get_indeces ( int &  rise,
int &  fall 
) const
virtual

Get the pulse phase bin indeces of the rise and fall.

Return values
risebin at which the cumulative power last remains above threshold
fallbin at which the cumulative power first falls below threshold

Implements Pulsar::RiseFall.

◆ set_threshold()

void Pulsar::PeakCumulative::set_threshold ( float  threshold)

Set the threshold.

Set the duty cycle.


The documentation for this class was generated from the following files:

Generated using doxygen 1.8.17