CARMA C++
Pointing.h
Go to the documentation of this file.
1 #ifndef POINTING_H
2 #define POINTING_H
3 
12 // Needed for SRC_LEN
13 
14 #include "carma/szaarrayutils/szaregs.h"
15 
16 #include "carma/szautil/Axis.h"
17 #include "carma/szautil/PmacMode.h"
18 #include "carma/szautil/RegDate.h"
19 
21 #include "carma/antenna/sza/antenna/control/Encoder.h"
26 
27 namespace sza {
28  namespace antenna {
29  namespace control {
30 
31 
32  class Tracker;
33 
37  class Pointing {
38 
39  public:
40 
44  enum PositionType {
45  MOUNT_ANGLES,
46  MOUNT_RATES,
47  TOPOCENTRIC,
48  GEOCENTRIC
49  };
50 
54  Pointing();
55 
59  void reset();
60 
61  // Methods to set up pointing in preparation for various moves
62 
66  void setupForHalt(SzaShare* share);
67 
71  void setupForReboot(SzaShare* share);
72 
76  void setupForSlew(SzaShare* share, TrackerMsg* msg);
77 
81  void setupForTrack();
82 
83  // Member modification methods
84 
88  void setTime(double utc);
89 
93  void setTime(int mjd, int sec);
94 
98  void setName(char* name);
99  unsigned char* getName();
100 
104  void setAxes(sza::util::Axis::Type axes);
105 
109  void setRa(double ra);
110 
114  void setDec(double dec);
115 
119  void setDist(double dist);
120 
124  void setRefraction(double refraction);
125 
126  // Member access methods
127 
132 
138 
142  double getUtc();
143  sza::util::RegDate getDate();
144 
148  double getRefraction();
149 
153  void convertMountToEncoder(Encoder* encoder,
154  PmacAxis* axis,
155  int current,
156  bool ignoreWrapLogic=true);
157 
164 
168  void setAngles(double az, double el, double pa);
169 
173  void setRates(double az, double el, double pa);
174 
178  void computeGeocentricPosition(double lst, PointingCorrections* f);
179 
183  void packUtc(unsigned* u_elements);
184 
190  void packSourceName(unsigned* u_elements, int nel);
191 
195  void packEquatGeoc(signed* s_elements);
196 
200  void packHorizGeoc(signed* s_elements);
201 
205  void packHorizTopo(signed* s_elements);
206 
210  void packHorizMount(signed* s_elements);
211 
212  bool isFixed();
213  bool isHalt();
214 
215  void setCurrentPosition(AxisPositions& axes);
216  AxisPositions currentPosition_;
218 
219  private:
220 
221  friend class Tracker;
222 
223  bool currentPositionIsSet_;
224 
228  double wrapPi(double angle);
229 
233  double wrap2pi(double angle);
234 
238  char name_[SRC_LEN];
239 
243  int mjd_, sec_;
244 
248  double ra_,dec_;
249 
253  double dist_;
254 
258  double refraction_;
259 
263  sza::antenna::control::Position geocentric_;
264 
268  sza::antenna::control::Position topocentric_;
269 
273  sza::antenna::control::Position mountAngles_;
274 
278  sza::antenna::control::Position mountRates_;
279 
280  sza::util::Axis::Type axes_; // The set of axes to drive,
281  // expressed as a bitwise
282  // union of Axis enumerators.
283 
284  bool isFixed_; // Is this a fixed source?
285  bool isHalt_; // Is this a request to halt the telescope?
286 
287  }; // End class Pointing
288 
289  }; // End namespace control
290  }; // End namespace antenna
291 }; // End namespace sza
292 
293 #endif // End #ifndef
The following class is used to record the horizon coordinates of a source.
Definition: Position.h:31
void packUtc(unsigned *u_elements)
Pack the UTC for archival into the register database.
The AxisPositions class is used by the Tracker class to record the positions of the telescope axes...
Definition: AxisPositions.h:31
Tagged: Thu Nov 13 16:53:43 UTC 2003.
void setAngles(double az, double el, double pa)
Install the angles to which the axes will be driven.
PositionType
An enumerator for the Position members below.
Definition: Pointing.h:44
void setRates(double az, double el, double pa)
Install the rates with which the axes will be driven.
void packHorizMount(signed *s_elements)
Pack mount horizon coordinates.
void setRa(double ra)
Set the RA of the source.
void setupForHalt(SzaShare *share)
Prepare for a halt of the antenna.
void packHorizGeoc(signed *s_elements)
Pack geocentric horizon coordinates.
void setupForTrack()
Prepare for a track command.
Tagged: Thu Nov 13 16:53:54 UTC 2003.
void setDec(double dec)
Set the Dec of the source.
void setRefraction(double refraction)
Install the refraction correction.
Objects of the following type are used to aggregate the encoder calibration parameters of each axis...
Definition: Encoder.h:24
While computing pointing corrections, an object of the following type is used to communicate accumula...
Tagged: Tue Oct 12 09:13:47 PDT 2004.
void packSourceName(unsigned *u_elements, int nel)
Pack the source name for archival in the register database.
double getRefraction()
Return the refraction correction.
sza::util::Axis::Type getAxes()
Get the mask of axes to be driven.
Type
An enumerator to identify a valid axis.
Definition: Axis.h:24
void packHorizTopo(signed *s_elements)
Pack topocentric horizon coordinates.
double getUtc()
Return the current UTC.
Tagged: Thu Nov 13 16:53:33 UTC 2003.
Mode
Enumerate the pmac control modes.
Definition: PmacMode.h:24
void setupForSlew(SzaShare *share, TrackerMsg *msg)
Prepare for a slew.
void setTime(double utc)
Set the current time.
bool includesAxis(sza::util::Axis::Type axis)
Return true if the passed axis is included in the set of axes to control.
A class used by Tracker to handle pointing.
Definition: Pointing.h:37
Tagged: Thu Nov 13 16:53:56 UTC 2003.
void reset()
Reset method.
void setupForReboot(SzaShare *share)
Prepare for a reboot (of the pmac).
Tagged: Thu Nov 13 16:53:45 UTC 2003.
void setName(char *name)
Set the current source name.
void convertMountToEncoder(Encoder *encoder, PmacAxis *axis, int current, bool ignoreWrapLogic=true)
Convert a mount angle to encoder counts.
void packEquatGeoc(signed *s_elements)
Pack geocentric equatorial coordinates.
Define a class that will handle pointing and tracking for this antenna.
Definition: Tracker.h:51
Tagged: Thu Nov 13 16:53:49 UTC 2003.
void setAxes(sza::util::Axis::Type axes)
Install the set of axes to drive.
sza::antenna::control::Position * Position(PositionType type)
Return a pointer to the requested pointing angle container.
An instance of this class is created by AntennaMaster and passed to the constructors of other tasks...
Definition: Share.h:38
void setDist(double dist)
Set the source distance.
void computeGeocentricPosition(double lst, PointingCorrections *f)
Compute the current geocentric position.
Encapsulate the encoder counts and rates for a telescope axis.
Definition: PmacAxis.h:26