Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/Telescopes/TCC/html/obj_8h_source.html
Дата изменения: Tue Sep 15 02:25:37 2015
Дата индексирования: Sat Apr 9 23:50:45 2016
Кодировка:

Поисковые слова: п п п п п п п п п п п п п
lsst.tcc: include/tcc/obj.h Source File
lsst.tcc  1.2.2-3-g89ecb63
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
obj.h
Go to the documentation of this file.
1 #pragma once
2 /*
3 Object block
4 
5 @todo Add Obj.desMount (mount of target); set cmdMount from the path generator.
6 But the path generator computes acceleration as well as pvt!
7 
8 Units are degrees and seconds; absolute time is TAI (MJD, in seconds).
9 
10 "p,v,t triplets", a.k.a. "coordinates" are position, velocity, time
11 triplets such that, given (po,vo,to): p(t) = po + vo * (t - to)
12 All refer to the current telescope position unless otherwise noted.
13 
14 All three-axis items are in the order: az, alt, rotator
15 
16 Regarding axes in the focal plane:
17 - Az/alt means the direction of increasing azimuth/altitude
18 - User 1/2 means the direction of increasing distance in the user's coordinate system (for example RA/Dec for FK5 coordinates).
19  User 1/2 is always a rotation of az/alt; there cannot be a mirror flip.
20 - Instrument x,y is always defined such that it is simply a rotation of az/alt; there cannot be a mirror flip of either axis.
21  Typically:
22  - y is along increasing columns of the CCD,
23  - x along the rows of the CCD, but with the necessary sign such that x,y is a rotation of az/alt
24 - 0 degrees is along the first axis (x, az or user 1)
25 - 90 degrees is along the second axis (y, alt or user 2)
26 */
27 #include <boost/tr1/array.hpp> // so array works with old and new compilers
28 #include "boost/shared_ptr.hpp"
29 #include "coordConv/coordConv.h"
30 #include "tcc/basics.h"
31 #include "tcc/cheby.h"
32 #include "tcc/pxPMRadVel.h"
33 #include "tcc/telConst.h"
34 
35 namespace tcc {
36 
40  class Obj {
41  public:
42  std::string name; // Name of object
43  coordConv::CoordSys::Ptr userSys; // Pointer to coordinate system code and epoch of object
44  std::tr1::array<coordConv::PVT, 2> userPos; // position of object in the specified userSys; ignored if useCheby true
45  PxPMRadVel userPxPMRadVel; // parallax, proper motion and radial velocity of object; ignored if useCheby true
46  // coordConv::PVTCoord userPos; // Position, proper motion, etc. of object in the specified userSys; ignored if useCheby true
47  bool useCheby; // Is the object position obtained from Chebyshev polynomials?
48  // If true: position and distance are obtained from cheby; userPos is ignored
49  // and the position is only valid if tai is in range [cheby.startTime, cheby.endTime]
50  // If false: position and parallax are obtained from userPos; chebyUser1, chebyUser2 and chebyDist are ignored.
51  RotTypeEnum rotType; // type of rotation (e.g. with object or horizon); see basics.h for codes
52  coordConv::PVT rotUser; // Rotator angle; the meaning depends on rot_type:
53  // - object: the angle of the user coordinate system w.r.t. the instrument.
54  // - horizon: the angle of az/alt w.r.t the instrument
55  // - mount: the angle sent to the axis controller
56  // - none: no rotation
57  WrapTypeEnum azWrapPref; // azimuth wrap preference
58  WrapTypeEnum rotWrapPref; // rotator wrap preference
59  double mag; // predicted magnitude
60  coordConv::Site site; // site information
61  coordConv::Site gsSite; // site information for guide star; just a different wavelength and refraction coefficients
62  // The following Chebyshev polynomials are used to describe object position and distance;
63  // They are ignored unless useCheby is true
64  ChebyshevPolynomial chebyUser1; // Object position axis 1 (TAI, MJD sec -> deg)
65  ChebyshevPolynomial chebyUser2; // Object position axis 2 (TAI, MJD sec -> deg)
66  ChebyshevPolynomial chebyDist; // Object distance (TAI, MJD sec -> au)
67 
68  // user-specified offsets and positions
69  std::tr1::array<coordConv::PVT, 2> userArcOff; // Offset of object position along a great circle
70 // bool doArcOffTDICorr; // correct arc offset velocity for drift scanning (TDI)?
71 // // if false, velocity is constant (for tracking moving objects);
72 // // if true, velocity is adjusted for refraction such that a constant readout rate may be used (for drift scanning)
73 
74  std::tr1::array<coordConv::PVT, 2> objInstXY; // user-set boresight pos. (aka instrument-plane offset (inst x,y);
75  std::tr1::array<coordConv::PVT, NAxes> guideOff; // net guiding correction (mount)
76  std::tr1::array<coordConv::PVT, NAxes> calibOff; // calibration offset (mount)
77 
78  double updateTime; // Time of last tracking update; TAI, MJD sec; 0 if none
79  double slewEndTime; // End time of slew or halt; TAI, MJD sec; 0 or stale if not slewing or halting
80 
81 // coordConv::PVT arcVelCorr; // Correction of user-specified arc offset velocity
82 // // (the velocity component is always zero);
83 // // useful because velocity varies slightly along the path in a complex way
84 // coordConv::PVT prevArcVelCorr; // Previously computed value of arcVelCorr;
85 // // again it helps handle the varying velocity of drift scanning
86  coordConv::PVTCoord zpmUserPos; // User position with parallax and proper motion removed to current date
87  // (but only for mean coordinates; it is simply a copy of userCoord for apparent coords).
88  coordConv::PVTCoord netUserPos; // Net user position, including all offsets; in "user" coordinates
89  coordConv::PVT arcUserNoArcUserAng; // Orientation of arc (of arc offset) at netUserPos (the offset position)
90  // minus orientation of arc at zpmUserPos (the un-offset position)
91  boost::shared_ptr<coordConv::ObsCoordSys> obsSysPtr; // Observed coordinate system for observed coordinates;
92  // I use a pointer because I can then access it in Python;
93  // it's an opaque object in Python if I use the object instead of a pointer
94  coordConv::PVTCoord obsPos; // Observed position at boresight (netUserPos converted to observed coordinates)
95  coordConv::PVT objUserObjAzAng; // Angle from azimuth axis to userSys equatorial axis (e.g. RA) at netUserPos
96  coordConv::PVT objAzInstAng; // Angle from instrument x axis to object azimuth axis
97  coordConv::PVT objUserInstAng; // Angle from instrument x axis to object userSys equatorial axis (e.g. RA)
98  coordConv::PVT rotAzObjAzAng; // Direction of increasing azimuth at center of rotator - direction of increasing azimuth at boresight
99  coordConv::PVT rotAzRotAng; // Direction of increasing azimuth at center of rotator in rotator frame
100  coordConv::PVT spiderInstAng; // Direction of increasing azimuth at optical axis (center of rotator) in the instrument frame;
101  // spiderInstAng = rotAzInstAng = rotAzRotAng - inst.inst_rot_ang
102  coordConv::PVT rotPhys; // Rotator physical angle: rotator angle before applying inst.rot_offset, rot_scale and wrap;
103  // if there is no rotator then rotPhys = inst.rot_fixed_phys
104 
105  std::tr1::array<coordConv::PVT, NAxes> targetMount; // Target mount position of each axis (az, alt and rot)
106  std::tr1::array<AxisStateEnum, NAxes> axisCmdState; // Commanded state of each axis
107  std::tr1::array<AxisErrEnum, NAxes> axisErrCode; // Error code of each axis; if the TCC has commanded a halt, this explains why
108  std::tr1::array<bool, NAxes> axisIsSignificant; // Is axis significant for the current slew command?
109 
110  std::tr1::array<coordConv::PVT, NAxes> actMount; // Actual mount position of each axis, as read from the axis controller
111  std::tr1::array<int, NAxes> axisStatusWord; // Status word last read from each axis controller
112  std::tr1::array<double, NAxes> axisStatusTime; // Time at which status was last read from each axis controller; TAI, MJD sec
113 
117  explicit Obj();
118 
124  bool isMoving(int axis) {
125  return (axisCmdState.at(axis) == AxisState_Tracking) || isSlewing(axis);
126  }
127 
131  bool isMoving();
132 
138  bool isSlewing(int axis) {
139  return ((axisCmdState.at(axis) == AxisState_Slewing)
140  || (axisCmdState.at(axis) == AxisState_Halting)
141  );
142  }
143 
147  bool isSlewing();
148  };
149 
150 }
coordConv::PVT objAzInstAng
Definition: obj.h:96
def axis
Definition: axis.py:11
coordConv::PVT rotUser
Definition: obj.h:52
bool isSlewing(int axis)
Definition: obj.h:138
boost::shared_ptr< coordConv::ObsCoordSys > obsSysPtr
Definition: obj.h:91
Obj()
Definition: obj.cc:7
std::tr1::array< coordConv::PVT, 2 > userPos
Definition: obj.h:44
RotTypeEnum
Definition: basics.h:32
double mag
Definition: obj.h:59
ChebyshevPolynomial chebyUser2
Definition: obj.h:65
coordConv::PVT rotAzRotAng
Definition: obj.h:99
std::tr1::array< coordConv::PVT, NAxes > actMount
Definition: obj.h:110
std::tr1::array< coordConv::PVT, 2 > objInstXY
Definition: obj.h:74
ChebyshevPolynomial chebyUser1
Definition: obj.h:64
coordConv::PVTCoord netUserPos
Definition: obj.h:88
std::tr1::array< AxisErrEnum, NAxes > axisErrCode
Definition: obj.h:107
std::tr1::array< coordConv::PVT, 2 > userArcOff
Definition: obj.h:69
std::string name
Definition: obj.h:42
double updateTime
Definition: obj.h:78
std::tr1::array< double, NAxes > axisStatusTime
Definition: obj.h:112
std::tr1::array< coordConv::PVT, NAxes > targetMount
Definition: obj.h:105
coordConv::Site gsSite
Definition: obj.h:61
coordConv::PVT rotAzObjAzAng
Definition: obj.h:98
bool useCheby
Definition: obj.h:47
coordConv::PVT arcUserNoArcUserAng
Definition: obj.h:89
WrapTypeEnum azWrapPref
Definition: obj.h:57
WrapTypeEnum
Definition: basics.h:47
double slewEndTime
Definition: obj.h:79
std::tr1::array< int, NAxes > axisStatusWord
Definition: obj.h:111
Definition: obj.h:40
coordConv::PVT objUserObjAzAng
Definition: obj.h:95
coordConv::PVT spiderInstAng
Definition: obj.h:100
std::tr1::array< bool, NAxes > axisIsSignificant
Definition: obj.h:108
bool isMoving(int axis)
Definition: obj.h:124
coordConv::PVT objUserInstAng
Definition: obj.h:97
WrapTypeEnum rotWrapPref
Definition: obj.h:58
ChebyshevPolynomial chebyDist
Definition: obj.h:66
coordConv::PVTCoord zpmUserPos
Definition: obj.h:86
coordConv::PVTCoord obsPos
Definition: obj.h:94
std::tr1::array< AxisStateEnum, NAxes > axisCmdState
Definition: obj.h:106
coordConv::Site site
Definition: obj.h:60
std::tr1::array< coordConv::PVT, NAxes > calibOff
Definition: obj.h:76
coordConv::CoordSys::Ptr userSys
Definition: obj.h:43
coordConv::PVT rotPhys
Definition: obj.h:102
bool isSlewing()
Definition: obj.cc:93
bool isMoving()
Definition: obj.cc:84
RotTypeEnum rotType
Definition: obj.h:51
std::tr1::array< coordConv::PVT, NAxes > guideOff
Definition: obj.h:75
PxPMRadVel userPxPMRadVel
Definition: obj.h:45
reference at(size_type __n)