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 
17 namespace Pulsar {
18 
19  class Archive;
20  class StokesCovariance;
21 
23  class FourthMomentStats : public PolnProfileStats {
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 
76  Estimate<double> get_moment_variance (unsigned) const;
77 
78  protected:
79 
81 
83  double duration;
84 
86  double folding_period;
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 
Jones< double > evaluate(std::vector< Jones< double > > *grad=0) const
void stats(const Profile *profile, double *mean, double *variance=0, double *varmean=0, double *varvar=0) const
Get the statistics of the weighted phase bins (deprecated interface)
Definition: PhaseWeight.C:420
const Profile * get_eigen_value(unsigned k)
Get the eigen values of the polarization vector space.
Definition: FourthMomentStats.C:59
Stokes< float > get_Stokes(unsigned ibin) const
Get the Stokes 4-vector for the specified bin.
Definition: PolnProfile.C:246
Reference::To< const PolnProfile, false > profile
The PolnProfile from which statistics will be derived.
Definition: PolnProfileStats.h:93
Estimate< double > get_moment_variance(unsigned) const
Returns the variance of the baseline for the specified moment.
Definition: FourthMomentStats.C:525
void get_weights(std::vector< float > &weights) const
Get the weights.
Definition: PhaseWeight.C:129
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
void solve()
Solve the equation.
Definition: ModeSeparation.C:268
void separate(PolnProfile &modeA, PolnProfile &modeB)
Get the mode-separated profiles.
Definition: FourthMomentStats.C:551
virtual unsigned get_nsubint() const =0
Get the number of sub-integrations stored in the file.
Stores a weight for each Profile phase bin.
Definition: PhaseWeight.h:29
void eigen(PolnProfile *=0, PolnProfile *=0, PolnProfile *=0)
Get the eigen polarization profiles.
Definition: FourthMomentStats.C:146
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
~FourthMomentStats()
Destructor.
Definition: FourthMomentStats.C:38
The primary interface to pulsar observational data.
Definition: Archive.h:45
double duration
The integration length.
Definition: FourthMomentStats.h:88
double bandwidth
The bandwidth in MHz.
Definition: FourthMomentStats.h:94
virtual unsigned get_nchan() const =0
Get the number of frequency channels used.
bool remove_eigen_baseline
Subtract the bias induced by sorting the eigen values.
Definition: FourthMomentStats.h:97
static const unsigned nmoment
The number of unique fourth moments in a Stokes covariance matrix.
Definition: StokesCovariance.h:36
unsigned get_nbin() const
Get the number of bins.
Definition: PolnProfile.C:139
Integration * get_Integration(unsigned subint)
Return pointer to the specified Integration.
Definition: IntegrationManager.C:41
double folding_period
The folding period.
Definition: FourthMomentStats.h:91
std::vector< Estimate< double > > moment_variance
The variance of the baseline for each moment.
Definition: FourthMomentStats.h:109
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
static void debias(Archive *, bool xcovar=true)
Worker function corrects bias in output of psr4th.
Definition: FourthMomentStats.C:625
Matrix< 4, 4, Estimate< double > > get_covariance(unsigned ibin) const
Get the estimated covariance matrix for the specified phase bin.
Definition: FourthMomentStats.C:502
void resize(unsigned nbin)
Set the number of bins.
Definition: PolnProfile.C:101
void set_profile(const PolnProfile *_profile)
Set the FourthMoment from which statistics will be derived.
Definition: FourthMomentStats.C:43
float get_avg() const
Get the weighted average of the Profile amplitudes.
Definition: PhaseWeight.C:345
PhaseWeight * baseline() const
Return a new PhaseWeight instance with the baseline phase bins masked.
Definition: Archive_baseline.C:11
Polarimetric pulse profile transformations and derivations.
Definition: PolnProfile.h:34
Separates polarized modes of emission.
Definition: ModeSeparation.h:28
FourthMomentStats(const PolnProfile *profile=0)
Default constructor.
Definition: FourthMomentStats.C:27
Computes polarimetric pulse profile statistics.
Definition: PolnProfileStats.h:27
void set_mean(const Stokes< Estimate< double > > &)
Set the estimated mean Stokes parameters.
Definition: ModeSeparation.C:182
Defines the PSRCHIVE library.
Definition: CalSource.h:17
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
const Profile * get_regression_coefficient(unsigned k)
Get the regression coefficients for each polarization vector.
Definition: FourthMomentStats.C:66
Phase-resolved four-dimensional covariance matrix of Stokes parameters.
Definition: StokesCovariance.h:31
void set_profile(const PolnProfile *)
Set the PolnProfile from which statistics will be derived.
Definition: PolnProfileStats.C:48
void set_covariance(const Matrix< 4, 4, Estimate< double > > &)
Set the estimated covariance matrix of the Stokes parameters.
Definition: ModeSeparation.C:218
const Profile * get_Profile(unsigned ipol) const
Get the specifed constant profile.
Definition: PolnProfile.C:147
void set_Profile(const Profile *profile) const
Set the Profile from which statistics are calculated.
Definition: PhaseWeight.C:303

Generated using doxygen 1.8.17