Finds the last significant harmonic in a flucuation power spectral density. More...

#include <LastHarmonic.h>

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

Public Member Functions

 LastHarmonic ()
 Default constructor.
void set_Profile (const Profile *psd)
 Set the flucuation power spectral density from which the last harmonic will be computed.
void set_threshold (float threshold)
 Set the threshold.
float get_threshold () const
 Get the threshold.
void set_consecutive (unsigned consecutive)
 Set the number of consecutive points that must remain above threshold.
unsigned get_consecutive () const
 Get the number of consecutive points that must remain above threshold.
unsigned get_last_harmonic () const
 Get the index of the last significant harmonic.
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 ()
const PhaseWeightget_baseline () const
void get_indeces (int &rise, int &fall) const
 Get the harmonic indeces of the rise and fall (rise always equals 1)
TextInterface::Parserget_interface ()
 Return a text interface that can be used to configure this instance.
LastHarmonicclone () 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.
 ProfileWeightFunction (const ProfileWeightFunction &)
 Copy 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.
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.
int bin_rise
int bin_fall
Reference::To< BaselineEstimatorbaseline_estimator
 The estimator used to find the off-pulse phase bins.
Reference::To< PhaseWeightbaseline
 The basline returned by the estimator.
LastSignificant significant
 The algorithm used to find the last signficant harmonic.
Reference::To< const Profilefluctuation_power_spectral_density
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

Finds the last significant harmonic in a flucuation power spectral density.

The last significant harmonic is defined by number of consecutive points above threshold.

This class violates strong behavioural subtyping (aka Liskov Substitution Principle) by inheriting RiseFall, which inherits OnPulseEstimator, which inherits ProfileWeightFunction. It does so only to re-use the machinery of these classes. The Profile object passed to this object is also not a phase-resolved average; it is the squared modulus of the Fouier transform of what we usually call a Profile.

Member Function Documentation

◆ clone()

Pulsar::LastHarmonic * Pulsar::LastHarmonic::clone ( ) const
virtual

Return new copy of self.

Implements Pulsar::OnPulseEstimator.

References LastHarmonic().

◆ get_indeces()

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

Get the harmonic indeces of the rise and fall (rise always equals 1)

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.

References build(), built, and LastHarmonic().

◆ get_interface()

TextInterface::Parser * Pulsar::LastHarmonic::get_interface ( )
virtual

Return a text interface that can be used to configure this instance.

Implements Pulsar::PhaseWeightFunction.

◆ set_Profile()

void Pulsar::LastHarmonic::set_Profile ( const Profile * psd)
virtual

Set the flucuation power spectral density from which the last harmonic will be computed.

The profile passed to this function should be the flucuation power spectral density; i.e. the squared modulus of the Fourier transform of an average pulse profile

Reimplemented from Pulsar::ProfileWeightFunction.

References built, and Pulsar::ProfileWeightFunction::profile.

Referenced by Pulsar::FluctSpectStats< ProfileType, ProfileStatsType >::build(), and Pulsar::ProfileShiftFit::choose_nharm().


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

Generated using doxygen 1.14.0