FourthMomentStats.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2009-2011 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Polarimetry/Pulsar/FourthMomentStats.h
10
11#ifndef __Pulsar_FourthMomentStats_h
12#define __Pulsar_FourthMomentStats_h
13
14#include "Pulsar/PolnProfileStats.h"
15#include "Matrix.h"
16
17namespace Pulsar {
18
19 class Archive;
20 class StokesCovariance;
21
24
25 public:
26
29
32
34 static void debias (Archive*, bool xcovar = true);
35
36 void set_profile (const PolnProfile* _profile);
37 void set_bandwidth (double bw);
38 void set_duration (double T) { duration = T; }
39 void set_folding_period (double P) { folding_period = P; }
40
41 void set_remove_eigen_baseline (bool flag) { remove_eigen_baseline = flag; }
42 bool get_remove_eigen_baseline () const { return remove_eigen_baseline; }
43
45 Matrix< 4,4,Estimate<double> > get_covariance (unsigned ibin) const;
46
47 const StokesCovariance* get_covariance () const;
48
50 void eigen (PolnProfile* = 0, PolnProfile* = 0, PolnProfile* = 0);
51
52 void smooth_eigenvectors (PolnProfile*, PolnProfile*, PolnProfile*);
53
55 const Profile* get_eigen_value (unsigned k);
56
58 const Profile* get_regression_coefficient (unsigned k);
59
61 const Profile* get_natural_covariance (unsigned k);
62
64 void separate (PolnProfile& modeA, PolnProfile& modeB);
65
68
69 Reference::To<Profile> get_nonorthogonality() { return nonorthogonality; }
70
71 Reference::To<Profile> get_sin_theta() { return sin_theta; }
72 Reference::To<Profile> get_cos_theta() { return cos_theta; }
73 Reference::To<Profile> get_norm_theta() { return norm_theta; }
74
77
78 protected:
79
81
83 double duration;
84
87
89 double bandwidth;
90
93
94 std::vector< Reference::To<Profile> > eigen_value;
95 std::vector< Reference::To<Profile> > regression_coefficient;
96 std::vector< Reference::To<Profile> > natural_covariance;
97 Reference::To<Profile> nonorthogonality;
98
99 Reference::To<Profile> sin_theta;
100 Reference::To<Profile> cos_theta;
101 Reference::To<Profile> norm_theta;
102
104 mutable std::vector< Estimate<double> > moment_variance;
105
106 void smooth (unsigned poln, unsigned ibin, Stokes<double>& match,
107 std::vector<PolnProfile*>& eigen_vector);
108
109 };
110
111}
112
113
114#endif
115
116
117
The primary interface to pulsar observational data.
Definition Archive.h:46
const Profile * get_eigen_value(unsigned k)
Get the eigen values of the polarization vector space.
Definition FourthMomentStats.C:59
Matrix< 4, 4, Estimate< double > > get_covariance(unsigned ibin) const
Get the estimated covariance matrix for the specified phase bin.
Definition FourthMomentStats.C:502
Estimate< double > get_moment_variance(unsigned) const
Returns the variance of the baseline for the specified moment.
Definition FourthMomentStats.C:525
void eigen(PolnProfile *=0, PolnProfile *=0, PolnProfile *=0)
Get the eigen polarization profiles.
Definition FourthMomentStats.C:146
static void debias(Archive *, bool xcovar=true)
Worker function corrects bias in output of psr4th.
Definition FourthMomentStats.C:625
void set_profile(const PolnProfile *_profile)
Set the FourthMoment from which statistics will be derived.
Definition FourthMomentStats.C:43
Reference::To< Profile > get_modulation_index()
Return the phase-resolved modulation index.
Definition FourthMomentStats.C:94
const Profile * get_natural_covariance(unsigned k)
Get covariance between polarized and total intensity in natural basis.
Definition FourthMomentStats.C:73
double bandwidth
The bandwidth in MHz.
Definition FourthMomentStats.h:89
double folding_period
The folding period.
Definition FourthMomentStats.h:86
bool remove_eigen_baseline
Subtract the bias induced by sorting the eigen values.
Definition FourthMomentStats.h:92
double duration
The integration length.
Definition FourthMomentStats.h:83
void separate(PolnProfile &modeA, PolnProfile &modeB)
Get the mode-separated profiles.
Definition FourthMomentStats.C:551
const Profile * get_regression_coefficient(unsigned k)
Get the regression coefficients for each polarization vector.
Definition FourthMomentStats.C:66
~FourthMomentStats()
Destructor.
Definition FourthMomentStats.C:38
FourthMomentStats(const PolnProfile *profile=0)
Default constructor.
Definition FourthMomentStats.C:27
std::vector< Estimate< double > > moment_variance
The variance of the baseline for each moment.
Definition FourthMomentStats.h:104
Reference::To< const PolnProfile, false > profile
The PolnProfile from which statistics will be derived.
Definition PolnProfileStats.h:105
PolnProfileStats(const PolnProfile *profile=0)
Default constructor.
Definition PolnProfileStats.C:19
Polarimetric pulse profile transformations and derivations.
Definition PolnProfile.h:29
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