ProfileWeightFunction.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2005 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/ProfileWeightFunction.h
10 
11 #ifndef __Pulsar_ProfileWeightFunction_h
12 #define __Pulsar_ProfileWeightFunction_h
13 
14 #include "Pulsar/PhaseWeightFunction.h"
15 
16 namespace Pulsar {
17 
18  class Profile;
19 
21  class ProfileWeightFunction : public PhaseWeightFunction
22  {
23 
24  public:
25 
28 
30  virtual ProfileWeightFunction* clone () const = 0;
31 
33  virtual void set_Profile (const Profile*);
34 
36  void set_include (PhaseWeight* include);
37 
39  void set_exclude (PhaseWeight* include);
40 
42  bool consider (unsigned ibin) const;
43 
45  virtual void get_weight (PhaseWeight* weight);
46 
48  virtual PhaseWeight* operate (const Profile*);
49 
51  static ProfileWeightFunction* factory (const std::string& name_and_parse);
52 
53  protected:
54 
57 
59  virtual void calculate (PhaseWeight* weight) = 0;
60 
63 
66 
67  };
68 
69  std::ostream& operator<< (std::ostream&, ProfileWeightFunction*);
70 
71  std::istream& operator>> (std::istream&, ProfileWeightFunction*&);
72 
73 }
74 
75 
76 #endif // !defined __Pulsar_BaselineWeightFunction_h
void set_include(PhaseWeight *include)
Include only the specified phase bins for consideration.
Definition: ProfileWeightFunction.C:43
Reference::To< PhaseWeight > include
Included phase bins.
Definition: ProfileWeightFunction.h:67
static ProfileWeightFunction * factory(const std::string &name_and_parse)
Construct a new ProfileWeightFunction from a string.
Definition: ProfileWeightFunction.C:79
virtual ProfileWeightFunction * clone() const =0
Return a copy constructed instance of self.
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
Type * release()
virtual PhaseWeight * operate(const Profile *)
Convenience interface.
Definition: ProfileWeightFunction.C:34
Set the Profile weights to a user-specified value.
Definition: ProfileWeightStatic.h:25
Reference::To< const Profile, false > profile
The Profile from which the PhaseWeight will be derived.
Definition: ProfileWeightFunction.h:61
Reference::To< PhaseWeight > exclude
Excluded phase bins.
Definition: ProfileWeightFunction.h:70
Adaptively computes the baseline, assuming normally distributed noise.
Definition: GaussianBaseline.h:70
Finds pulse defined by number of consecutive points above threshold.
Definition: PeakConsecutive.h:31
void set_exclude(PhaseWeight *include)
Exclude the specified phase bins from consideration.
Definition: ProfileWeightFunction.C:48
Finds the phase window in which the smoothed Profile is an extremum.
Definition: BaselineWindow.h:28
PhaseWeight algorithms that receive an input Profile.
Definition: ProfileWeightFunction.h:26
Find the edges of a pulse.
Definition: PeakCumulative.h:55
bool consider(unsigned ibin) const
Return true if the specified phase bin should be considered.
Definition: ProfileWeightFunction.C:53
virtual void get_weight(PhaseWeight *weight)
Returns a PhaseWeight with the Profile attribute set.
Definition: ProfileWeightFunction.C:26
virtual void set_Profile(const Profile *)
Set the Profile from which the PhaseWeight will be derived.
Definition: ProfileWeightFunction.C:20
Finds a baseline that contains gaussian white noise.
Definition: ExponentialBaseline.h:24
virtual void calculate(PhaseWeight *weight)=0
Derived classes implement the PhaseWeight calculation.
ProfileWeightFunction()
Default constructor.
Definition: ProfileWeightFunction.C:15
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Uses the baseline statistics to find on-pulse phase bins.
Definition: OnPulseThreshold.h:31
Finds a baseline that falls within the the inter-quartile range.
Definition: IQRBaseline.h:24

Generated using doxygen 1.8.17