Receiver.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/Base/Extensions/Pulsar/Receiver.h
10 
11 #ifndef __ReceiverExtension_h
12 #define __ReceiverExtension_h
13 
14 #include "Pulsar/ArchiveExtension.h"
15 #include "Jones.h"
16 #include "Stokes.h"
17 #include "Angle.h"
18 
19 namespace Pulsar {
20 
22 
23  class Receiver : public Archive::Extension {
24 
25  public:
26 
28  static Receiver* load (const std::string& filename);
29 
31  static Receiver* new_Receiver (const std::string& text);
32 
34  Receiver ();
35 
37  Receiver (const Receiver& extension);
38 
40  const Receiver& operator= (const Receiver& extension);
41 
43  ~Receiver ();
44 
46  Receiver* clone () const { return new Receiver(*this); }
47 
49  std::string get_short_name () const { return "rcvr"; }
50 
53 
54  class Interface;
55 
57  void parse (std::string text);
58 
60  enum Tracking {
62  Feed,
64  Celestial,
66  Galactic
67  };
68 
72  void set_tracking_mode (Tracking mode) { tracking_mode = mode; }
73 
75  Angle get_tracking_angle () const { return tracking_angle; }
77  void set_tracking_angle (const Angle& angle) { tracking_angle = angle; }
78 
80  std::string get_name () const { return name; }
82  void set_name (const std::string& _name) { name = _name; }
83 
85  int get_nrcvr( void ) { return nrcvr; }
87  void set_nrcvr( const int s_nrcvr ) { nrcvr = s_nrcvr; }
88 
90  Signal::Basis get_basis () const { return state->get_basis(); }
91 
93  void set_basis (Signal::Basis basis);
94 
100 
102  Angle get_orientation () const { return state->get_orientation(); }
104  void set_orientation (const Angle& celestial_position_angle);
105 
107  Signal::Hand get_hand () const { return state->get_hand(); }
109  void set_hand (Signal::Hand);
110 
113  { return state->get_reference_source_phase(); }
115  void set_reference_source_phase (const Angle& phase);
116 
118 
123 
125  Angle get_field_orientation () const;
127  void set_field_orientation (const Angle& celestial_position_angle);
128 
130 
136 
138  Angle get_X_offset () const;
140  void set_X_offset (const Angle& offset);
141 
143  Angle get_Y_offset () const;
145  void set_Y_offset (const Angle& offset);
146 
148  Angle get_calibrator_offset () const;
150  void set_calibrator_offset (const Angle& offset);
151 
153 
155  bool get_basis_corrected () const { return basis_corrected; }
157  void set_basis_corrected (bool);
158 
160  bool get_projection_corrected () const { return projection_corrected; }
162  void set_projection_corrected (bool val) { projection_corrected = val; }
163 
165  float get_atten_a () const { return atten_a; }
167  void set_atten_a (float atten) { atten_a = atten; }
168 
170  float get_atten_b () const { return atten_b; }
172  void set_atten_b (float atten) { atten_b = atten; }
173 
175  bool match (const Receiver* receiver, std::string& reason) const;
176 
178  std::string get_tracking_mode_string() const;
179 
181  Stokes<double> get_reference_source () const;
182 
184  class State : public Reference::Able {
185  public:
186 
188  virtual Signal::Basis get_basis () const = 0;
189 
191  virtual Signal::Hand get_hand () const = 0;
192 
194  virtual Angle get_orientation () const = 0;
195 
196 
198  virtual Angle get_reference_source_phase () const = 0;
199 
201  virtual void copy (const State*) = 0;
202 
203  };
204 
205  class Native;
206  class Linear;
207  class Field;
208 
209  protected:
210 
211  template<class StateType> StateType* get() const;
212 
214  std::string name;
215 
217  int nrcvr;
218 
221 
224 
226 
228 
230 
234 
236 
240 
242 
243  float atten_a;
244 
246 
247  float atten_b;
248 
249  };
250 
251 }
252 
253 #endif
void set_nrcvr(const int s_nrcvr)
Set the number of receptors.
Definition: Receiver.h:97
bool get_basis_corrected() const
Return true when receptor basis has been corrected.
Definition: Receiver.h:165
std::string name
Name of the receiver.
Definition: Receiver.h:224
void add(T(P::*get)() const, const char *name, const char *description=0)
Receiver()
Default constructor.
Definition: Receiver.C:37
void phase(Profile *input)
Compute the phase of the input complex-valued Profile.
Definition: Fourier.C:135
const Receiver & operator=(const Receiver &extension)
Operator =.
Definition: Receiver.C:61
Angle get_field_orientation() const
Get the orientation of the equal in-phase electric field vector.
Definition: Receiver.C:128
The internal state of the Receiver Extension class.
Definition: Receiver.h:194
void set_Y_offset(const Angle &offset)
Set the offset of the feed Y axis from its nominal value.
Definition: Receiver.C:149
TextInterface::Parser * get_interface()
Return a text interfaces that can be used to access this instance.
Definition: Receiver.C:285
void set_hand(Signal::Hand)
Set the hand of the basis.
Definition: Receiver.C:112
int nrcvr
Number of receptors.
Definition: Receiver.h:227
Reference::To< State > state
State of the receiver.
Definition: Receiver.h:230
std::string get_short_name() const
Return an abbreviated name that can be typed relatively quickly.
Definition: Receiver.h:59
std::string get_name() const
Get the name of the receiver.
Definition: Receiver.h:90
void set_basis(Signal::Basis basis)
Set the basis of the feed receptors.
Definition: Receiver.C:97
void set_name(const std::string &_name)
Set the name of the receiver.
Definition: Receiver.h:92
bool get_projection_corrected() const
Return true when receptor projection onto sky has been corrected.
Definition: Receiver.h:170
StateType * get() const
Definition: Receiver.C:22
virtual Angle get_orientation() const =0
Get the orientation of the basis about the line of sight.
Tracking
Different modes of feed rotational tracking.
Definition: Receiver.h:70
Stores receptor basis, hand, and orientation, and calibrator phase.
Definition: Receiver_Native.h:24
Angle get_Y_offset() const
Get the offset of the feed Y axis from its nominal value.
Definition: Receiver.C:154
Contains information about the receiver and receiver platform.
Definition: Receiver.h:28
virtual void set_instance(C *c)
std::string get_tracking_mode_string() const
Return a string that describes the tracking mode.
Definition: Receiver.C:84
Receiver * clone() const
Clone method.
Definition: Receiver.h:56
Angle get_tracking_angle() const
Get the position angle tracked by the receiver.
Definition: Receiver.h:85
Signal::Basis get_basis() const
Get the basis of the feed receptors.
Definition: Receiver.h:100
Stokes< double > get_reference_source() const
Return the Stokes parameters of the reference source.
Definition: Receiver.C:220
@ Galactic
Constant Galactic position angle.
Definition: Receiver.h:76
virtual Signal::Hand get_hand() const =0
Get the hand of the basis.
bool match(const Receiver *receiver, std::string &reason) const
Return true if the receiver configurations match.
Definition: Receiver.C:182
void set_projection_corrected(bool val)
Set true when receptor projection onto sky has been corrected.
Definition: Receiver.h:172
int get_nrcvr(void)
Get the number of receptors.
Definition: Receiver.h:95
float get_atten_a() const
Get the attenuator, Poln A.
Definition: Receiver.h:175
virtual Signal::Basis get_basis() const =0
Get the basis of the feed receptors.
void set_calibrator_offset(const Angle &offset)
Set the offset of the feed calibrator axis from its nominal value.
Definition: Receiver.C:164
Angle get_calibrator_offset() const
Get the offset of the feed calibrator axis from its nominal value.
Definition: Receiver.C:169
@ Celestial
Constant Celestial position angle.
Definition: Receiver.h:74
bool projection_corrected
Flag set when platform to sky transformation has been corrected.
Definition: Receiver.h:249
void set_basis_corrected(bool)
Set true when receptor basis has been corrected.
Definition: Receiver.C:174
void set_field_orientation(const Angle &celestial_position_angle)
Set the orientation of the equal in-phase electric field vector.
Definition: Receiver.C:123
void set_atten_b(float atten)
Set the attenuator, Poln B.
Definition: Receiver.h:182
Stores the X and Y receptor and calibrator orientations.
Definition: Receiver_Linear.h:24
Angle get_X_offset() const
Get the offset of the feed X axis with respect to the platform zero.
Definition: Receiver.C:140
void parse(std::string text)
Parses the value of a Receiver attribute from a string.
Definition: Receiver_load.C:38
void set_reference_source_phase(const Angle &phase)
Set the phase of the reference source.
Definition: Receiver.C:118
void set_atten_a(float atten)
Set the attenuator, Poln A.
Definition: Receiver.h:177
virtual std::string get_interface_name() const
static Receiver * new_Receiver(const std::string &text)
Construct a new Receiver instance from a string.
Definition: Receiver_load.C:30
Tracking get_tracking_mode() const
Get the tracking mode of the receiver platform.
Definition: Receiver.h:80
static unsigned verbose
A verbosity flag that can be set for debugging purposes.
Definition: IntegrationManager.h:38
void set_X_offset(const Angle &offset)
Set the offset of the feed X axis with respect to the platform zero.
Definition: Receiver.C:135
@ Feed
Constant feed angle.
Definition: Receiver.h:72
void set_tracking_angle(const Angle &angle)
Get the position angle tracked by the receiver.
Definition: Receiver.h:87
void set_tracking_mode(Tracking mode)
Set the tracking mode of the receiver platform.
Definition: Receiver.h:82
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Angle tracking_angle
The rotation angle tracked by the feed.
Definition: Receiver.h:237
Angle get_orientation() const
Get the orientation of the basis about the line of sight.
Definition: Receiver.h:112
bool basis_corrected
Flag set when the offset of the feed has been corrected.
Definition: Receiver.h:243
Angle get_reference_source_phase() const
Get the phase of the reference source.
Definition: Receiver.h:122
float atten_a
Attenuator, Poln A.
Definition: Receiver.h:253
virtual void copy(const State *)=0
Copy from another State.
void set_orientation(const Angle &celestial_position_angle)
Set the orientation of the basis about the line of sight.
Definition: Receiver.C:105
float get_atten_b() const
Get the attenuator, Poln B.
Definition: Receiver.h:180
Tracking tracking_mode
The tracking mode of the receiver platform.
Definition: Receiver.h:233
float atten_b
Attenuator, Poln B.
Definition: Receiver.h:257
Signal::Hand get_hand() const
Get the hand of the basis.
Definition: Receiver.h:117
static Receiver * load(const std::string &filename)
Construct a new Receiver instance from a file.
Definition: Receiver_load.C:15
~Receiver()
Destructor.
Definition: Receiver.C:80
Stores the field orientation.
Definition: Receiver_Field.h:29
virtual Angle get_reference_source_phase() const =0
Get the phase of the reference source.

Generated using doxygen 1.8.17