PolnProfile.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2003 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Polarimetry/Pulsar/PolnProfile.h
10
11#ifndef __Pulsar_PolnProfile_h
12#define __Pulsar_PolnProfile_h
13
14#include "Pulsar/Profile.h"
15
16#include "Stokes.h"
17#include "Jones.h"
18#include "Matrix.h"
19#include "Quaternion.h"
20
21namespace Pulsar {
22
23 class StokesCovariance;
25
27
29 class PolnProfile : public Container {
30
31 public:
32
35
37 PolnProfile ();
38
40 PolnProfile (unsigned nbin);
41
44 Profile* p0, Profile* p1, Profile* p2, Profile* p3);
45
47 virtual ~PolnProfile();
48
50 virtual PolnProfile* clone () const;
51
53 void resize (unsigned nbin);
54
56 unsigned get_nbin () const;
57
59 const Profile* get_Profile (unsigned ipol) const;
60
62 Profile* get_Profile (unsigned ipol);
63
65 const float* get_amps (unsigned ipol) const;
66
68 float* get_amps (unsigned ipol);
69
71 void set_amps (unsigned ipol, float* amps);
72
75
77 PhaseWeight* get_baseline () const;
78
80 void sum (const PolnProfile* that);
81
83 void diff (const PolnProfile* that);
84
86 Signal::Basis get_basis () const { return basis; }
87
89 Signal::State get_state () const { return state; }
90
92 Stokes<float> get_Stokes (unsigned ibin) const;
93
95 void set_Stokes (unsigned ibin, const Stokes<float>&);
96
98 Jones<double> get_coherence (unsigned ibin) const;
99
101 void set_coherence (unsigned ibin, const Jones<double>&);
102
104 Quaternion<float,Hermitian> get_pseudoStokes (unsigned ibin) const;
105
107 void set_pseudoStokes (unsigned ibin, const Quaternion<float,Hermitian>&);
108
110 double sum (int bin_start=0, int bin_end=0) const;
111
113 double sumsq (int bin_start=0, int bin_end=0) const;
114
116 void scale (double scale);
117
119 void rotate_phase (double turns);
120
122 void transform (const Jones<double>& response);
123
125 void transform (const Matrix<4,4,double>& response);
126
128 void convert_state (Signal::State state);
129
132
134 void invint (Profile* invint, bool second = true) const;
135
137 void invconv (Profile*) const;
138
140 void get_linear (Profile*) const;
141
143 void get_linear_squared (Profile*) const;
144
146 double get_linear_variance () const;
147
149 double get_linear_variance (std::pair<double,double>& qu_var) const;
150
152 void get_circular (Profile*) const;
153
155 void get_polarized (Profile*) const;
156
158 void get_polarized_squared (Profile*) const;
159
161 void get_orientation (std::vector< Estimate<double> >&, float sigma) const;
162
164 void get_ellipticity (std::vector< Estimate<double> >&, float sigma) const;
165
166 void get_linear (std::vector< std::complex< Estimate<double> > >& L, float sigma) const;
167
168 const StokesCovariance* get_covariance () const;
169 StokesCovariance* get_covariance ();
170
171 protected:
172
175
178
181
184
187
190
192 void check (const char* method, Signal::State want_state, unsigned want_ibin) const;
193
195 void sum_difference (Profile* sum, Profile* difference);
196
198 void init ();
199
201 void get_root_sum_squared(Profile* rss, unsigned jpol, unsigned kpol,
202 BaselineEstimator* baseline_estimator = 0) const;
203
205 void get_sum_squared(Profile* rss, unsigned jpol, unsigned kpol) const;
206 };
207
208}
209
210
211#endif
212
213
214
ProfileWeight algorithms that compute profile baselines.
Definition BaselineEstimator.h:19
Data storage implementations.
Definition Container.h:19
Stores a weight for each Profile phase bin.
Definition PhaseWeight.h:24
void set_pseudoStokes(unsigned ibin, const Quaternion< float, Hermitian > &)
Set the pseudo-Stokes 4-vector for the specified bin.
Definition PolnProfile.C:284
void get_ellipticity(std::vector< Estimate< double > > &, float sigma) const
Return the ellipticity and its estimated error for each pulse phase.
Definition PolnProfile.C:794
void convert_basis(Signal::Basis basis)
Convert the Stokes parameters to the specified basis.
Definition PolnProfile.C:545
void check(const char *method, Signal::State want_state, unsigned want_ibin) const
Throw an exception if want_state != state or want_ibin >= nbin.
Definition PolnProfile.C:225
PhaseWeight * get_baseline() const
Get the baseline (if not the one set above, then the default)
Definition PolnProfile.C:203
void get_orientation(std::vector< Estimate< double > > &, float sigma) const
Return the orientation and its estimated error for each pulse phase.
Definition PolnProfile.C:923
PolnProfile()
Default constructor.
Definition PolnProfile.C:36
Reference::To< PhaseWeight > my_baseline
The baseline derived from the data.
Definition PolnProfile.h:186
void sum(const PolnProfile *that)
Add that to this.
Definition PolnProfile.C:117
Signal::Basis get_basis() const
Get the Basis of the poln profile.
Definition PolnProfile.h:86
void get_linear(Profile *) const
Return the linear polarization profile.
Definition PolnProfile.C:760
void rotate_phase(double turns)
Rotate the phase of each profile.
Definition PolnProfile.C:339
void convert_state(Signal::State state)
Convert to the specified state.
Definition PolnProfile.C:451
static bool normalize_weight_by_absolute_gain
When set, PolnProfile::transform will normalize the Profile::weight.
Definition PolnProfile.h:34
Jones< double > get_coherence(unsigned ibin) const
Get the coherency matrix for the specified bin.
Definition PolnProfile.C:298
Signal::State state
The state of the polarimetric profiles.
Definition PolnProfile.h:177
void get_circular(Profile *) const
Return the absolute circular polarization profile.
Definition PolnProfile.C:779
void get_polarized_squared(Profile *) const
Return the total polarization squared profile.
Definition PolnProfile.C:751
double get_linear_variance() const
Return the variance of L estimated from off-pulse Q and U.
Definition PolnProfile.C:859
void set_Stokes(unsigned ibin, const Stokes< float > &)
Set the Stokes 4-vector for the specified bin.
Definition PolnProfile.C:255
void set_baseline(PhaseWeight *)
Set the baseline used by some methods.
Definition PolnProfile.C:325
void init()
Set everthing to null values.
Quaternion< float, Hermitian > get_pseudoStokes(unsigned ibin) const
Get the pseudo-Stokes 4-vector for the specified bin.
Definition PolnProfile.C:270
void transform(const Jones< double > &response)
Perform the congruence transformation on each bin of the profile.
Definition PolnProfile.C:358
Reference::To< PhaseWeight > baseline
The baseline set in set_baseline.
Definition PolnProfile.h:183
Stokes< float > get_Stokes(unsigned ibin) const
Get the Stokes 4-vector for the specified bin.
Definition PolnProfile.C:242
const float * get_amps(unsigned ipol) const
Returns a const pointer to the start of the array of amplitudes.
Definition PolnProfile.C:167
void scale(double scale)
multiplies each bin of each profile by scale
Definition PolnProfile.C:330
const Profile * get_Profile(unsigned ipol) const
Get the specifed constant profile.
Definition PolnProfile.C:143
double sumsq(int bin_start=0, int bin_end=0) const
Returns the sum of all amplitudes squared.
Definition PolnProfile.C:440
void resize(unsigned nbin)
Set the number of bins.
Definition PolnProfile.C:101
virtual PolnProfile * clone() const
Clone operator.
Definition PolnProfile.C:42
void set_coherence(unsigned ibin, const Jones< double > &)
Set the coherency matrix for the specified bin.
Definition PolnProfile.C:312
unsigned get_nbin() const
Get the number of bins.
Definition PolnProfile.C:135
void sum_difference(Profile *sum, Profile *difference)
Efficiently forms the inplace sum and difference of two profiles.
Definition PolnProfile.C:521
Signal::State get_state() const
Get the State of the poln profile.
Definition PolnProfile.h:89
void get_polarized(Profile *) const
Return the total polarization profile.
Definition PolnProfile.C:742
void invconv(Profile *) const
Return the invariant autoconvolution.
Definition PolnProfile.C:603
Signal::Basis basis
The basis in which the radiation is measured.
Definition PolnProfile.h:174
void invint(Profile *invint, bool second=true) const
Return the invariant interval.
Definition PolnProfile.C:570
void get_linear_squared(Profile *) const
Return the linear polarization squared profile.
Definition PolnProfile.C:770
Reference::To< Profile > profile[4]
References to the polarimetric profiles.
Definition PolnProfile.h:180
Reference::To< StokesCovariance > covariance
The phase-resolved four-dimensional Stokes covariance matrix.
Definition PolnProfile.h:189
void get_sum_squared(Profile *rss, unsigned jpol, unsigned kpol) const
Does the work for get_root_sum_squared, get_polarized_squared and get_linear_squared.
Definition PolnProfile.C:721
virtual ~PolnProfile()
Destructor.
Definition PolnProfile.C:92
void get_root_sum_squared(Profile *rss, unsigned jpol, unsigned kpol, BaselineEstimator *baseline_estimator=0) const
Does the work for get_polarized and get_linear.
Definition PolnProfile.C:684
void diff(const PolnProfile *that)
Subtract that from this.
Definition PolnProfile.C:126
void set_amps(unsigned ipol, float *amps)
Set the amplitudes of the specified polarization.
Definition PolnProfile.C:191
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
Phase-resolved four-dimensional covariance matrix of Stokes parameters.
Definition StokesCovariance.h:26
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0