CoherencyMeasurement.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Polarimetry/Pulsar/CoherencyMeasurement.h
10 
11 #ifndef __Calibration_CoherencyMeasurement_H
12 #define __Calibration_CoherencyMeasurement_H
13 
14 #include "MEAL/Argument.h"
15 #include "Reference.h"
16 #include "Estimate.h"
17 #include "Stokes.h"
18 #include "Jones.h"
19 
20 #include <complex>
21 
22 namespace Calibration {
23 
25  /* Among other things, this class implements the interface of the
26  MEAL::WeightingScheme class used by MEAL::LevenbergMacquardt */
27  class CoherencyMeasurement {
28 
29  public:
30 
32  class Uncertainty;
33 
35  CoherencyMeasurement (unsigned input_index = 0);
36 
38  void set_input_index (unsigned index);
39 
41  unsigned get_input_index () const;
42 
44  void set_stokes (const Stokes< Estimate<double> >& stokes);
45 
47  void set_stokes (const Stokes< std::complex<double> >& stokes,
48  const Stokes<double>& variance);
49 
51  void set_stokes (const Stokes< std::complex<double> >& stokes,
52  const Uncertainty* var);
53 
55  unsigned get_nconstraint () const;
56 
59 
61  Stokes< Estimate<double> > get_stokes () const;
62 
64  Stokes< std::complex< Estimate<double> > > get_complex_stokes () const;
65 
67  double get_weighted_norm (const Jones<double>& matrix) const;
68 
71 
72  void get_weighted_components (const Jones<double>&,
73  std::vector<double>& components) const;
74 
76  const Uncertainty* get_uncertainty () const { return uncertainty; }
77 
79  void add_coordinate (MEAL::Argument::Value* abscissa);
80 
82  void set_coordinates () const;
83 
84  protected:
85 
87  std::vector< Reference::To<MEAL::Argument::Value> > coordinates;
88 
90  unsigned input_index;
91 
93  unsigned nconstraint;
94 
97 
99  Stokes<double> variance;
100 
103 
104  };
105 
108  {
109  public:
110 
112  virtual Uncertainty* clone () const = 0;
113 
115  virtual void add (const Uncertainty*) = 0;
116 
118  virtual
119  double
120  get_weighted_norm (const Jones<double>&) const = 0;
121 
123  virtual
125  get_weighted_conjugate (const Jones<double>&) const = 0;
126 
127  virtual
128  Stokes< std::complex<double> >
129  get_weighted_components (const Jones<double>&) const = 0;
130 
132  virtual
133  Stokes< std::complex<double> >
134  get_variance () const = 0;
135 
136  };
137 }
138 
139 
140 
141 #endif
const Uncertainty * get_uncertainty() const
The uncertainty of the measurement.
Definition: CoherencyMeasurement.h:86
CoherencyMeasurement(unsigned input_index=0)
Default constructor.
Definition: CoherencyMeasurement.C:17
Jones< double > rho
The coherency matrix measurement.
Definition: CoherencyMeasurement.h:106
virtual Stokes< std::complex< double > > get_variance() const =0
Return the variance of each Stokes parameter.
const Integration * get_Integration(const Archive *data, Index subint)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:118
void set_coordinates() const
Apply the independent variables.
Definition: CoherencyMeasurement.C:193
Estimates the uncertainty of a CoherencyMeasurement.
Definition: CoherencyMeasurement.h:112
void clean_Pointing_columns(fitsfile *) const
Delete Pointing-related columns, if not needed.
Definition: clean_Pointing_columns.C:13
Stokes< Estimate< double > > get_stokes() const
Get the measured Stokes parameters.
Definition: CoherencyMeasurement.C:61
The primary interface to pulsar observational data.
Definition: Archive.h:45
std::vector< Reference::To< MEAL::Argument::Value > > coordinates
The coordinates of the measurement.
Definition: CoherencyMeasurement.h:97
unsigned input_index
Index of the input to which the measurement corresponds.
Definition: CoherencyMeasurement.h:100
unsigned nconstraint
The number of constraints provided by this measurement.
Definition: CoherencyMeasurement.h:103
Combines the uncertainty of the template and the observation.
Definition: ObservationUncertainty.h:24
double get_weighted_norm(const Jones< double > &matrix) const
Given a coherency matrix, return the weighted norm.
Definition: CoherencyMeasurement.C:130
Reference::To< const Uncertainty > uncertainty
The uncertainty of the measurement.
Definition: CoherencyMeasurement.h:112
virtual double get_weighted_norm(const Jones< double > &) const =0
Given a coherency matrix, return the weighted norm.
Verifies that each Integration has a consistent DeFaraday Extension.
Definition: DeFaradayed.h:32
void set_input_index(unsigned index)
Set the index of the input to which the measurement corresponds.
Definition: CoherencyMeasurement.C:24
virtual void add(const Uncertainty *)=0
Add the uncertainty of another instance.
virtual Jones< double > get_weighted_conjugate(const Jones< double > &) const =0
Given a coherency matrix, return the weighted conjugate matrix.
unsigned get_nconstraint() const
Get the number of constraints provided by this measurement.
Definition: CoherencyMeasurement.C:36
Stokes< std::complex< Estimate< double > > > get_complex_stokes() const
Get the measured Stokes parameters.
Definition: CoherencyMeasurement.C:76
Jones< double > get_coherency() const
Get the measured coherency matrix.
Definition: CoherencyMeasurement.C:123
void set_stokes(const Stokes< Estimate< double > > &stokes)
Set the measured Stokes parameters.
Definition: CoherencyMeasurement.C:43
Corrects the Signal::Source type attribute of the Archive.
Definition: CalSource.h:28
void add_coordinate(MEAL::Argument::Value *abscissa)
Add an independent variable.
Definition: CoherencyMeasurement.C:188
virtual Uncertainty * clone() const =0
Return a copy constructed clone of self.
Stokes< double > variance
The variance (if given)
Definition: CoherencyMeasurement.h:109
unsigned get_input_index() const
Set the index of the input to which the measurement corresponds.
Definition: CoherencyMeasurement.C:30
Jones< double > get_weighted_conjugate(const Jones< double > &matrix) const
Given a coherency matrix, return the weighted conjugate matrix.
Definition: CoherencyMeasurement.C:142
Verifies that each Integration has a consistent Dedisperse Extension.
Definition: Dedispersed.h:32

Generated using doxygen 1.8.17