WidthEstimator.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2016 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/WidthEstimator.h
10 
11 #ifndef __Pulsar_WidthEstimator_h
12 #define __Pulsar_WidthEstimator_h
13 
14 #include "Pulsar/Algorithm.h"
15 #include "TextInterface.h"
16 #include "PhaseRange.h"
17 
18 namespace Pulsar {
19 
20  class Profile;
21 
23 
26  class WidthEstimator : public Algorithm
27  {
28  protected:
29 
31  virtual double get_width_turns (const Profile* profile) = 0;
32 
33  public:
34 
36  virtual Phase::Value get_width (const Profile* profile);
37 
39  virtual TextInterface::Parser* get_interface () = 0;
40 
42  virtual WidthEstimator* clone () const = 0;
43 
45  static WidthEstimator* factory (const std::string& name_and_parse);
46 
47  };
48 
49 }
50 
51 
52 #endif // !defined __Pulsar_WidthEstimator_h
static WidthEstimator * factory(const std::string &name_and_parse)
Construct a new WidthEstimator from a string.
Definition: WidthEstimator.C:26
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
float find_min_phase(float duty_cycle=default_duty_cycle) const
Returns the phase of the centre of the region with minimum mean.
Definition: Profile_find_minmax_phase.C:21
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
virtual WidthEstimator * clone() const =0
Return a copy constructed instance of self.
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
Stores Parkes Wideband Correlator parameters.
Definition: WidebandCorrelator.h:27
const ScalarMath sqrt(const ScalarMath &x)
virtual double get_width_turns(const Profile *profile)=0
Derived classes must implement this method.
float max(int bin_start=0, int bin_end=0) const
Returns the maximum amplitude.
Definition: Profile.C:651
void stats(double *mean, double *variance=0, double *varmean=0, int bin_start=0, int bin_end=0) const
Calculates the mean, variance, and variance of the mean.
Definition: Profile_stats.C:27
virtual TextInterface::Parser * get_interface()=0
Return a text interface that can be used to configure this instance.
virtual Phase::Value get_width(const Profile *profile)
Return the width of the pulse profile in turns.
Definition: WidthEstimator.C:17
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Algorithms that estimate the width of the pulse profile.
Definition: WidthEstimator.h:31

Generated using doxygen 1.8.17