PhaseWidth.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/PhaseWidth.h
10 
11 #ifndef __Pulsar_PhaseWidth_h
12 #define __Pulsar_PhaseWidth_h
13 
14 #include "Pulsar/WidthEstimator.h"
15 #include "Pulsar/HasBaselineEstimator.h"
16 #include "Pulsar/PhaseWeight.h"
17 
18 namespace Pulsar {
19 
21 
22  class PhaseWidth : public WidthEstimator, public HasBaselineEstimator
23  {
24  // stores the estimated uncertainty in pulse width estimate
25  Phase::Value error;
26 
27  // height at which to estimate width
28  float fraction_of_maximum;
29 
30  // threshold above noise below which algorithm gives up
31  float threshold_above_noise;
32 
34  mutable PhaseWeight baseline;
35 
36  public:
37 
39  PhaseWidth ();
40 
42  double get_width_turns (const Profile* profile);
43 
44  Phase::Value get_error () const { return error; }
45 
46  float get_fraction_of_maximum () const { return fraction_of_maximum; }
47  void set_fraction_of_maximum (float);
48 
51 
53  class Interface;
54 
56  PhaseWidth* clone () const;
57 
58  };
59 
60 }
61 
62 #endif
63 
float min(int bin_start=0, int bin_end=0) const
Returns the minimum amplitude.
Definition: Profile.C:665
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: PhaseWidth.C:162
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
int find_min_bin(int bin_start=0, int bin_end=0) const
Returns the bin number with the minimum amplitude.
Definition: Profile.C:636
Stores a weight for each Profile phase bin.
Definition: PhaseWeight.h:29
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
Calculates the pulse width in the phase domain.
Definition: PhaseWidth.h:27
unsigned get_nbin() const
Return the number of bins.
Definition: ProfileAmps.h:50
float max(int bin_start=0, int bin_end=0) const
Returns the maximum amplitude.
Definition: Profile.C:651
Finds the phase window in which the smoothed Profile is an extremum.
Definition: BaselineWindow.h:28
double get_width_turns(const Profile *profile)
Return the width of the pulse profile in turns.
Definition: PhaseWidth.C:59
PhaseWidth()
Default constructor.
Definition: PhaseWidth.C:22
Defines the PSRCHIVE library.
Definition: CalSource.h:17
PhaseWidth * clone() const
Return a copy constructed instance of self.
Definition: PhaseWidth.C:168
int find_max_bin(int bin_start=0, int bin_end=0) const
Returns the bin number with the maximum amplitude.
Definition: Profile.C:622

Generated using doxygen 1.8.17