Calculates the signal-to-noise ratio using (on-off)/rms. More...

#include <SquareWave.h>

Inheritance diagram for Pulsar::SquareWave:
Pulsar::SNRatioEstimator Pulsar::Algorithm Reference::Able Reference::HeapTracked

Public Member Functions

 SquareWave ()
 Default constructor.
 
float get_snr (const Profile *profile)
 Return the signal to noise ratio.
 
TextInterface::Parserget_interface ()
 Return a text interface that can be used to configure this instance.
 
SquareWaveclone () const
 Return a copy constructed instance of self.
 
void get_transitions (const Profile *profile, std::vector< unsigned > &up, std::vector< unsigned > &down)
 Search for multiple level transitions. More...
 
unsigned count_transitions (const Profile *profile)
 Count the level transitions.
 
void levels (const Integration *subint, std::vector< std::vector< Estimate< double > > > &high, std::vector< std::vector< Estimate< double > > > &low)
 
PhaseWeightget_mask (const Profile *, bool on, int start, int low)
 Returns the phase bins that were not flagged as outliers.
 
void set_risetime (float turns)
 Set the rise time of the square wave in turns of phase.
 
float get_risetime () const
 Get the rise time of the square wave in turns of phase.
 
void set_threshold (float turns)
 Set the threshold for square wave detection.
 
float get_threshold () const
 Get the threshold for square wave detection.
 
void set_outlier_threshold (float f)
 Set the threshold used to reject outliers when computing levels.
 
float get_outlier_threshold () const
 Get the threshold used to reject outliers when computing levels.
 
- 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
 

Public Attributes

bool verbose
 

Static Public Attributes

static Option< float > transition_phase
 If set, use the specified pulse phase for lo->hi transition.
 

Protected Attributes

float risetime
 
float threshold
 
unsigned use_nbin
 
float outlier_threshold
 

Additional Inherited Members

- Static Public Member Functions inherited from Pulsar::SNRatioEstimator
static SNRatioEstimatorfactory (const std::string &name_and_parse)
 Construct a new SNRatioEstimator 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 ()
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 

Detailed Description

Calculates the signal-to-noise ratio using (on-off)/rms.

This class also computes the levels used in calibration

Member Function Documentation

◆ get_transitions()

void Pulsar::SquareWave::get_transitions ( const Profile profile,
std::vector< unsigned > &  up,
std::vector< unsigned > &  down 
)

Search for multiple level transitions.

This method identifies significant transitions between high and low states using the differences in fluxes between phase bins separated by risetime turns. Significant transitions occur where the absolute value of the difference in flux exceeds a threshold times the standard deviation of the baseline noise.

References Pulsar::Profile::clone(), Pulsar::BaselineWindow::find_phase(), Pulsar::ProfileAmps::get_nbin(), Pulsar::BaselineWindow::get_smooth(), Pulsar::BaselineWindow::set_find_mean(), and Pulsar::Smooth::set_turns().


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

Generated using doxygen 1.8.17