StokesCrossCovariance.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2009 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Polarimetry/Pulsar/StokesCrossCovariance.h
10 
11 #ifndef __Pulsar_StokesCrossCovariance_h
12 #define __Pulsar_StokesCrossCovariance_h
13 
14 #include "Pulsar/Container.h"
15 
16 #include "Stokes.h"
17 #include "Jones.h"
18 #include "Matrix.h"
19 
20 namespace Pulsar {
21 
22  class CrossCovarianceMatrix;
23 
25 
26  class StokesCrossCovariance : public Container
27  {
28 
29  public:
30 
32  StokesCrossCovariance (const CrossCovarianceMatrix* = 0);
33 
35  void load (const CrossCovarianceMatrix*);
36 
38  void unload (CrossCovarianceMatrix*);
39 
40  class Stream;
41 
43  virtual StokesCrossCovariance* clone () const;
44 
46  unsigned get_nbin () const;
47  void set_nbin (unsigned);
48 
50  unsigned get_nlag () const;
51  void set_nlag (unsigned);
52 
54  void resize ();
55 
57  void set_all (double val = 0.0);
58 
61  unsigned jbin,
62  unsigned ilag = 0) const;
63 
66  unsigned jbin,
67  unsigned ilag = 0);
68 
70  void set_cross_covariance (unsigned ibin, unsigned jbin,
71  const Matrix<4,4,double>&, bool lock = false);
72 
74  void set_cross_covariance (unsigned ibin, unsigned jbin, unsigned ilag,
75  const Matrix<4,4,double>&, bool lock = false);
76 
78  unsigned get_icross (unsigned ibin, unsigned jbin, unsigned ilag=0) const;
79 
81  unsigned get_ncross (unsigned ilag) const;
82 
84  unsigned get_ncross_total () const;
85 
86  protected:
87 
88  unsigned nbin;
89  unsigned nlag;
90 
91  unsigned get_icross_check (unsigned ibin, unsigned jbin, unsigned ilag,
92  const char*) const;
93 
95  std::vector< Matrix<4,4,double> > cross_covariance;
96  std::vector< bool > locked;
97  };
98 
99 }
100 
101 
102 #endif
103 
104 
105 
StokesCrossCovariance(const CrossCovarianceMatrix *=0)
Construct from a CrossCovarianceMatrix object.
Definition: StokesCrossCovariance.C:20
std::vector< Matrix< 4, 4, double > > cross_covariance
The cross covariance matrix for each phase bin pair.
Definition: StokesCrossCovariance.h:100
void unload(CrossCovarianceMatrix *)
Unload to a CrossCovarianceMatrix object.
Definition: StokesCrossCovariance.C:147
unsigned get_ncross(unsigned ilag) const
Get the number of cross-covariance matrices for the specified lag.
Definition: StokesCrossCovariance.C:292
unsigned get_nbin() const
Get the number of longitude bins.
Definition: StokesCrossCovariance.C:241
virtual StokesCrossCovariance * clone() const
Clone operator.
Definition: StokesCrossCovariance.C:233
Cross-covariances between the Stokes parameters.
Definition: StokesCrossCovariance.h:31
void load(const CrossCovarianceMatrix *)
Load from a CrossCovarianceMatrix object.
Definition: StokesCrossCovariance.C:28
Pure virtual base class of a stream of covariances stored in blocks.
Definition: CrossCovarianceMatrix.h:104
void set_all(double val=0.0)
Set all values to specified value.
Definition: StokesCrossCovariance.C:412
void set_cross_covariance(unsigned ibin, unsigned jbin, const Matrix< 4, 4, double > &, bool lock=false)
Set the Stokes covariance for the specified bin.
Definition: StokesCrossCovariance.C:329
void resize()
Pepare to store.
Definition: StokesCrossCovariance.C:399
unsigned get_ncross_total() const
Get the total number of cross-covariance matrices.
Definition: StokesCrossCovariance.C:300
Defines the PSRCHIVE library.
Definition: CalSource.h:17
unsigned get_icross(unsigned ibin, unsigned jbin, unsigned ilag=0) const
Get the offset for the specified bin pair and lag.
Definition: StokesCrossCovariance.C:267
Matrix< 4, 4, double > get_cross_covariance(unsigned ibin, unsigned jbin, unsigned ilag=0) const
Get the Stokes cross covariance for the specified pair of bins.
Definition: StokesCrossCovariance.C:309
unsigned get_nlag() const
Get the number of lage.
Definition: StokesCrossCovariance.C:254

Generated using doxygen 1.8.17