CalibratorStokes.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/Base/Extensions/Pulsar/CalibratorStokes.h
10 
11 #ifndef __CalibratorStokes_h
12 #define __CalibratorStokes_h
13 
14 #include "Pulsar/HasChannels.h"
15 #include "Stokes.h"
16 #include "Estimate.h"
17 
18 namespace Pulsar {
19 
21 
23  class CalibratorStokes : public HasChannels {
24 
25  public:
26 
29  {
30  BeforeProjection, // e.g. satellite-borne
31  BeforeBasis, // e.g. radiated onto primary reflector
32  BeforeFrontend, // e.g. radiated into feedhorn
33  BeforeIdeal, // e.g. coupled after transducer
34  BeforeBackend, // not sure why
35  Unknown // don't know
36  };
37 
40 
42  CalibratorStokes (const CalibratorStokes& extension);
43 
45  const CalibratorStokes& operator= (const CalibratorStokes& extension);
46 
49 
51  CalibratorStokes* clone () const { return new CalibratorStokes( *this ); }
52 
55 
57  class Interface;
58 
60  std::string get_short_name () const { return "ref"; }
61 
63  void set_nchan (unsigned nchan);
65  unsigned get_nchan () const;
66 
71 
73  void remove_chan (unsigned first, unsigned last);
74 
76  void set_valid (unsigned ichan, bool valid);
78  bool get_valid (unsigned ichan) const;
79 
81  void set_stokes (unsigned ichan, const Stokes< Estimate<float> >& stokes);
83  Stokes< Estimate<float> > get_stokes (unsigned ichan) const;
84 
85  unsigned get_nparam () const { return 3; /* Stokes Q,U,V */ }
86  Estimate<float> get_Estimate ( unsigned iparam, unsigned ichan ) const;
87  void set_Estimate (unsigned iparam, unsigned ichan, Estimate<float>&);
88 
90  void frequency_append (Archive* to, const Archive* from);
91 
92  protected:
93 
95 
104 
106 
107  std::vector< Stokes< Estimate<float> > > stokes;
108 
110  void range_check (unsigned ichan, const char* method) const;
111 
112  friend class CalibratorStokes::Interface;
113 
114  // Internal convenience interface to the Stokes polarization vector data
115  class PolnVector;
116 
118  PolnVector* get_poln (unsigned ichan);
119 
121  };
122 
123  std::ostream& operator << (std::ostream& ostr,
125  std::istream& operator >> (std::istream& is,
127 
128 }
129 
130 #endif
void set_coupling_point(CouplingPoint)
Set the point where the reference source signal is coupled.
Definition: CalibratorStokes.C:49
CalibratorStokes()
Default constructor.
Definition: CalibratorStokes.C:16
bool get_valid(unsigned ichan) const
Get the validity flag for the specified channel.
Definition: CalibratorStokes.C:88
PolnVector * get_poln(unsigned ichan)
Interface to StokesVector.
Definition: CalibratorStokes.C:202
The primary interface to pulsar observational data.
Definition: Archive.h:45
unsigned get_nchan() const
Get the number of frequency channels.
Definition: CalibratorStokes.C:67
Stores the Stokes parameters of the reference source.
Definition: CalibratorStokes.h:28
CouplingPoint coupling_point
The point where the reference source signal is coupled.
Definition: CalibratorStokes.h:113
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
CouplingPoint
The point where the reference source signal is coupled
Definition: CalibratorStokes.h:38
void set_stokes(unsigned ichan, const Stokes< Estimate< float > > &stokes)
Set the Stokes parameters of the specified frequency channel.
Definition: CalibratorStokes.C:96
const CalibratorStokes & operator=(const CalibratorStokes &extension)
Assignment operator.
Definition: CalibratorStokes.C:35
CalibratorStokes * clone() const
Clone method.
Definition: CalibratorStokes.h:61
void remove_chan(unsigned first, unsigned last)
Remove the inclusive range of channels.
Definition: CalibratorStokes.C:72
void set_valid(unsigned ichan, bool valid)
Set the validity flag for the specified channel.
Definition: CalibratorStokes.C:78
void range_check(unsigned ichan, const char *method) const
Ensure that ichan <= get_nchan.
Definition: CalibratorStokes.C:135
std::vector< Stokes< Estimate< float > > > stokes
The Stokes parameters for each frequency channel.
Definition: CalibratorStokes.h:117
~CalibratorStokes()
Destructor.
Definition: CalibratorStokes.C:44
Archive extensions that contain information for each frequency channel.
Definition: HasChannels.h:25
bool in_frequency_order(const Archive *A, const Archive *B)
Return true if A precedes B in frequency order of channels.
Definition: Archive.C:364
void set_nchan(unsigned nchan)
Set the number of frequency channels.
Definition: CalibratorStokes.C:61
void frequency_append(Archive *to, const Archive *from)
Append CalibratorStokes Extension data from another Archive.
Definition: CalibratorStokes.C:143
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Stokes< Estimate< float > > get_stokes(unsigned ichan) const
Get the Stokes parameters of the specified frequency channel.
Definition: CalibratorStokes.C:107
CouplingPoint get_coupling_point() const
The point where the reference source signal is coupled.
Definition: CalibratorStokes.C:55
TextInterface::Parser * get_interface()
Get the text ineterface.
Definition: CalibratorStokes.C:230
std::string get_short_name() const
Return a short name.
Definition: CalibratorStokes.h:70

Generated using doxygen 1.8.17