SquareWave.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2004 - 2016 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/General/Pulsar/SquareWave.h
10
11#ifndef __Pulsar_SquareWave_h
12#define __Pulsar_SquareWave_h
13
14#include "Pulsar/Config.h"
15#include "Pulsar/SNRatioEstimator.h"
16#include "Estimate.h"
17
18namespace Pulsar {
19
20 class Profile;
21 class Integration;
22 class PhaseWeight;
23
25
27
28 public:
29
32
34 SquareWave ();
35
37 float get_snr (const Profile* profile);
38
41
43 class Interface;
44
46 SquareWave* clone () const;
47
49 void get_transitions (const Profile* profile,
50 std::vector<unsigned>& up,
51 std::vector<unsigned>& down);
52
54 unsigned count_transitions (const Profile* profile);
55
56 void levels (const Integration* subint,
57 std::vector<std::vector<Estimate<double> > >& high,
58 std::vector<std::vector<Estimate<double> > >& low);
59
61 PhaseWeight* get_mask (const Profile*, bool on, int start, int low);
62
64 void set_risetime (float turns) { risetime = turns; }
65
67 float get_risetime () const { return risetime; }
68
70 void set_threshold (float turns) { threshold = turns; }
71
73 float get_threshold () const { return threshold; }
74
76 void set_outlier_threshold (float f) { outlier_threshold = f; }
77
79 float get_outlier_threshold () const { return outlier_threshold; }
80
81 bool verbose;
82
83 protected:
84
85 float risetime;
86 float threshold;
87 unsigned use_nbin;
88 float outlier_threshold;
89 };
90
91}
92
93#endif
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
Configuration option.
Definition Config.h:69
Stores a weight for each Profile phase bin.
Definition PhaseWeight.h:24
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
Algorithms that estimate the signal-to-noise ratio of pulse profiles.
Definition SNRatioEstimator.h:23
float get_threshold() const
Get the threshold for square wave detection.
Definition SquareWave.h:73
SquareWave()
Default constructor.
Definition SquareWave.C:38
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition SquareWave.C:413
void set_outlier_threshold(float f)
Set the threshold used to reject outliers when computing levels.
Definition SquareWave.h:76
void get_transitions(const Profile *profile, std::vector< unsigned > &up, std::vector< unsigned > &down)
Search for multiple level transitions.
Definition SquareWave.C:127
void set_threshold(float turns)
Set the threshold for square wave detection.
Definition SquareWave.h:70
float get_outlier_threshold() const
Get the threshold used to reject outliers when computing levels.
Definition SquareWave.h:79
static Option< float > transition_phase
If set, use the specified pulse phase for lo->hi transition.
Definition SquareWave.h:31
void set_risetime(float turns)
Set the rise time of the square wave in turns of phase.
Definition SquareWave.h:64
SquareWave * clone() const
Return a copy constructed instance of self.
Definition SquareWave.C:419
float get_risetime() const
Get the rise time of the square wave in turns of phase.
Definition SquareWave.h:67
PhaseWeight * get_mask(const Profile *, bool on, int start, int low)
Returns the phase bins that were not flagged as outliers.
Definition SquareWave.C:212
float get_snr(const Profile *profile)
Return the signal to noise ratio.
Definition SquareWave.C:48
unsigned count_transitions(const Profile *profile)
Count the level transitions.
Definition SquareWave.C:174
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0