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
17namespace Calibration
18{
19
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
46 void set_align_phase (bool flag) { align_phase = flag; }
47
48 protected:
49
50 friend class MultipleRanking;
51
53 virtual void extra (const Pulsar::Archive*);
54
57
59 std::vector<unsigned> bins;
60
62 bool align_phase = true;
63 };
64
65 class MaximumPolarization : public StandardPrepare
66 {
67 public:
68
70 double get_rank (unsigned ibin);
71
72 };
73
74 class MaximumIntensity : public StandardPrepare
75 {
76 public:
77
79 double get_rank (unsigned ibin);
80
81 };
82
83 class MaximumOrthogonality : public StandardPrepare
84 {
85 public:
86
88 double get_rank (unsigned ibin);
89
91 void set_chosen (unsigned ibin);
92
93 protected:
94
96 Stokes<float> last_chosen;
97
98 };
99
100 class MaximumInvariant : public StandardPrepare
101 {
102 public:
103
105 double get_rank (unsigned ibin);
106
108 void extra (const Pulsar::Archive*);
109
110 protected:
111
113 Reference::To<Pulsar::Profile> invariant;
114
115 };
116
117 class MultipleRanking : public StandardPrepare
118 {
119 public:
120
122 MultipleRanking ();
123
125 void add (StandardPrepare*);
126
128 double get_rank (unsigned ibin);
129
131 void set_chosen (unsigned ibin);
132
134 void extra (const Pulsar::Archive*);
135
136 protected:
137
139 std::vector< Reference::To<StandardPrepare> > rankings;
140
142 unsigned current;
143
144 };
145
146}
147
148#endif
Conditions input data and selects optimal input states.
Definition StandardPrepare.h:22
virtual void prepare(Pulsar::Archive *)
Prepare the data for use by the StandardData class.
Definition StandardPrepare.C:43
virtual void set_chosen(unsigned ibin)
Called when a phase bin has been chosen.
Definition StandardPrepare.C:117
void set_align_phase(bool flag)
Align data to the phase model in prepare method.
Definition StandardPrepare.h:46
virtual double get_rank(unsigned ibin)=0
Return the rank of the specified phase bin.
virtual void set_input_states(unsigned)
Set the number of input states to be chosen.
Definition StandardPrepare.C:60
std::vector< unsigned > bins
The chosen phase bins.
Definition StandardPrepare.h:59
Reference::To< Pulsar::PolnProfile > profile
The total integrated polarization profile.
Definition StandardPrepare.h:56
virtual void get_bins(std::vector< unsigned > &) const
Return the selected bins.
Definition StandardPrepare.C:66
virtual void choose(const Pulsar::Archive *)
Choose the input states.
Definition StandardPrepare.C:72
bool align_phase
Align data to the phase model.
Definition StandardPrepare.h:62
virtual void extra(const Pulsar::Archive *)
Do anything extra required to choose.
Definition StandardPrepare.C:121
The primary interface to pulsar observational data.
Definition Archive.h:46

Generated using doxygen 1.14.0