StandardPrepare.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/Polarimetry/Pulsar/StandardPrepare.h
10 
11 #ifndef __Calibration_StandardPrepare_H
12 #define __Calibration_StandardPrepare_H
13 
14 #include "Pulsar/Archive.h"
15 #include "Pulsar/PolnProfile.h"
16 
17 namespace Calibration
18 {
19 
21  class StandardPrepare : public Reference::Able
22  {
23  public:
24 
25  static StandardPrepare* factory (std::string name);
26 
28  virtual void prepare (Pulsar::Archive*);
29 
31  virtual void set_input_states (unsigned);
32 
34  virtual void choose (const Pulsar::Archive*);
35 
37  virtual double get_rank (unsigned ibin) = 0;
38 
40  virtual void set_chosen (unsigned ibin);
41 
43  virtual void get_bins (std::vector<unsigned>&) const;
44 
45  protected:
46 
47  friend class MultipleRanking;
48 
50  virtual void extra (const Pulsar::Archive*);
51 
54 
56  std::vector<unsigned> bins;
57 
58  };
59 
60  class MaximumPolarization : public StandardPrepare
61  {
62  public:
63 
65  double get_rank (unsigned ibin);
66 
67  };
68 
69  class MaximumIntensity : public StandardPrepare
70  {
71  public:
72 
74  double get_rank (unsigned ibin);
75 
76  };
77 
78  class MaximumOrthogonality : public StandardPrepare
79  {
80  public:
81 
83  double get_rank (unsigned ibin);
84 
86  void set_chosen (unsigned ibin);
87 
88  protected:
89 
91  Stokes<float> last_chosen;
92 
93  };
94 
95  class MaximumInvariant : public StandardPrepare
96  {
97  public:
98 
100  double get_rank (unsigned ibin);
101 
103  void extra (const Pulsar::Archive*);
104 
105  protected:
106 
109 
110  };
111 
112  class MultipleRanking : public StandardPrepare
113  {
114  public:
115 
117  MultipleRanking ();
118 
120  void add (StandardPrepare*);
121 
123  double get_rank (unsigned ibin);
124 
126  void set_chosen (unsigned ibin);
127 
129  void extra (const Pulsar::Archive*);
130 
131  protected:
132 
134  std::vector< Reference::To<StandardPrepare> > rankings;
135 
137  unsigned current;
138 
139  };
140 
141 }
142 
143 #endif
virtual void choose(const Pulsar::Archive *)
Choose the input states.
Definition: StandardPrepare.C:66
The primary interface to pulsar observational data.
Definition: Archive.h:45
std::vector< unsigned > bins
The chosen phase bins.
Definition: StandardPrepare.h:66
virtual double get_rank(unsigned ibin)=0
Return the rank of the specified phase bin.
Reference::To< Pulsar::PolnProfile > profile
The total integrated polarization profile.
Definition: StandardPrepare.h:63
Conditions input data and selects optimal input states.
Definition: StandardPrepare.h:26
virtual void extra(const Pulsar::Archive *)
Do anything extra required to choose.
Definition: StandardPrepare.C:115
virtual Archive * clone() const =0
Return a new copy constructed instance equal to this.
virtual void set_chosen(unsigned ibin)
Called when a phase bin has been chosen.
Definition: StandardPrepare.C:111
virtual void set_input_states(unsigned)
Set the number of input states to be chosen.
Definition: StandardPrepare.C:54
virtual void get_bins(std::vector< unsigned > &) const
Return the selected bins.
Definition: StandardPrepare.C:60
virtual void prepare(Pulsar::Archive *)
Prepare the data for use by the StandardData class.
Definition: StandardPrepare.C:43

Generated using doxygen 1.8.17