1 from __future__
import division, absolute_import
9 __all__ = [
"TCCCmdParser"]
15 help =
"ICRS RA, Dec (deg); date is Julian date (years) of observation and defaults to 2000",
16 numValueRange = [0,1],
21 help =
"FK5 RA, Dec (deg); date is Julian date (years) of equinox and of observation and defaults to 2000",
22 numValueRange = [0,1],
24 defValueList=[2000.0],
28 help =
"FK4 RA, Dec (deg); date is Besselian date (years) of equinox and of observation and defaults to 1950",
29 numValueRange = [0,1],
31 defValueList=[1950.0],
35 help =
"IAU 1958 galactic long, lat (deg); date is Julian date (years) of observation and defaults to the current date",
36 numValueRange = [0,1],
41 help=
"apparent geocentric RA, Dec (deg); date is Julian date (years) and defaults to the current date",
42 numValueRange = [0,1],
47 help=
"Apparent topocentric az, alt (deg) without correction for atmospheric refraction; " +
48 "date is TAI (MJD, sec) and defaults to the current date.",
49 numValueRange = [0,1],
54 help=
"Refracted apparent topocentric az, alt (deg); date is TAI (MJD, sec) and defaults to the current date.",
55 numValueRange = [0,1],
60 help=
"Mount coordinates (az, alt deg); note that azimuth is used as given; it is never wrapped).",
61 numValueRange = [0,0],
65 help=
"No object; do not track.",
66 numValueRange = [0,0],
70 help=
"Instrument focal plane coordinates (x, y deg, i.e. relative to nominal center of instrument).",
71 numValueRange = [0,0],
75 help=
"Guide image focal plane coordinates (x, y unbinned pixels, " +
76 "where 0.5, 0.5 is the center of the lower left pixel of the CCD); " +
77 "accepts one value: the guide probe number, which defaults to 0",
78 numValueRange = [1,1],
84 help=
"Guide probe focal plane coordinates (x, y deg, i.e. relative to nominal center of guide problem); " +
85 "accepts one value: the guide probe number, which defaults to 0",
86 numValueRange = [1,1],
92 help=
"Pointing correction (x, y deg): the same as rotator x, y except that x is along the direction of increasing az",
93 numValueRange = [0,0],
97 help=
"Rotator focal plane coordinates (x, y deg). 0,0 is the center of rotation and should be the optical axis. " +
98 "Rotator coordinates have a fixed offset and rotation angle with respect to the instrument; " +
99 "these are specified in the Inst block.",
100 numValueRange = [0,0],
105 """!TCC command parser
108 """!Construct a tccCmdParser
111 TimeLimit = parseDefs.Qualifier(
"TimeLimit", numValueRange=[1,1], valType=float,
112 help =
"Specify timeout time for communication with controllers.",
115 class RestartQual(parseDefs.Qualifier):
116 def __init__(self, defValueList, helpIfOmitted):
117 """Construct a Restart qualifier.
119 @param[in] helpIfOmitted describe what happens if you omit /Restart, e.g. "all axes are restarted"
121 axisList = [
"all",
"azimuth",
"altitude",
"rotator",
"tel1",
"tel2"]
122 fullAxisList = axisList + [
"no" + axis
for axis
in axisList]
123 fullAxisStr =
", ".join(fullAxisList)
125 parseDefs.Qualifier.__init__(self,
128 valType = fullAxisList,
129 numValueRange = [0,
None],
130 defValueList = defValueList,
132 help =
"""Restart one or more axes.
134 * Valid values are {%s},
135 where All restarts all axes that are not explicitly negated
136 * /Restart restarts all axes that exist
137 * /NoRestart restarts no axes
138 * If you specify one or more axes (Azimuth, Altitude and/or Rotator), only those are restarted
139 * If you specify one or more negated axes (NoAzimuth, NoAltitude and/or NoRotator)
140 those are left halted, and the other axes are restarted as per the rules above
141 * If there is no instrument rotator, Rotator is silently ignored
142 * Conflicts such as /Restart=(Az, NoAz) are prohibited (but All is acceptable with negated axes)
144 /Restart or /Restart=All: restart all axes
145 /Restart=Az: restart only azimuth
146 /Restart=NoRot: restart the default axes, excluding the rotator
147 /NoRestart: restart no axes""" % (helpIfOmitted, fullAxisStr),
150 Perfect = parseDefs.Qualifier(
152 help =
"Prevents the requested move from happening unless all axes can be moved.",
155 class AbsRefCorrect(parseDefs.Qualifier):
157 parseDefs.Qualifier.__init__(self,
158 name =
"absRefCorrect",
160 help =
"Specifies whether or not to apply absolute encoder corrections during a move.",
161 defBoolValue = defBoolValue,
164 class RefCoefficients(parseDefs.Qualifier):
166 parseDefs.Qualifier.__init__(self,
167 name =
"refCoefficients",
169 help =
"Specifies whether to update the refraction coefficients in the obj and/or gs block.",
170 defBoolValue=defBoolValue,
173 class Collimate(parseDefs.Qualifier):
175 parseDefs.Qualifier.__init__(self,
178 help =
"Specifies whether to update the position of the mirrors to maintain " \
179 "collimation as a function of temperature and altitude position.",
180 defBoolValue=defBoolValue,
183 Stop = parseDefs.Qualifier(
185 help =
"The instrument rotator will be gently stopped.",
188 class WrapPref(parseDefs.Qualifier):
189 def __init__(self, name, axisName, defValue):
190 parseDefs.Qualifier.__init__(self,
192 valType = [
"nearest",
"middle",
"negative",
"positive"],
193 numValueRange = [1, 1],
194 defValueList = (defValue,),
195 help =
"""Specify the desired wrap for the %s; valid values are:
196 - Nearest: use the angle nearest to the current position. This is the default for /AzWrap and is also used for all offsets (except for offsets in mount coordinates, of course).
197 - Middle: use the angle nearest the center of the range of motion. For example, if the range of motion is -190 to +370, the middle wrap range is -90 to +270. This is the default for /RotWrap (except during offsets), to reduce the odds that an exposure will be halted because the rotator hits a limit.
198 - Negative use the smaller angle. For example, if the range of motion is -190 to +370, the wrap range is -190 to +170. See the notes for details.
199 - Positive: use the larger angle. For example, if the range of motion is -190 to +370, the positive wrap range is 10 to 370. See the notes for details.
202 - Nearest is the only wrap preference that pays any attention to the current position.
203 - The positive and negative wrap ranges are as follows:
204 - If range of motion < 720 degrees then postive/negative wrap extends from the forward/reverse limit through -/+ 360 degrees.
205 - If range of motion > 720 degrees then positive/negative wrap extends from the center of the range of motion through +/- 360 degrees.
209 RotWrap = WrapPref(name=
"rotWrap", axisName=
"instrument rotator", defValue=
"middle")
211 AzWrap = WrapPref(name=
"azWrap", axisName=
"azimuth axis", defValue=
"nearest")
213 Input = parseDefs.Qualifier(
215 numValueRange = [1,1],
217 help =
"The specified file is used for input.",
220 NoRead = parseDefs.Qualifier(
223 help =
"Ignore existing values",
226 Name = parseDefs.Qualifier(
229 numValueRange = [1,1],
230 help =
"The name of the object.",
233 Magnitude = parseDefs.Qualifier(
235 numValueRange = [1,1],
237 defValueList = (
'NaN',),
238 help =
"Object brightness.",
241 Distance = parseDefs.Qualifier(
243 numValueRange = [1,1],
245 help =
"distance to object in au.",
248 PM = parseDefs.Qualifier(
250 numValueRange = [2,2],
252 defValueList = (0,0),
253 help =
"Proper motion in arcseconds/century. Equatorial proper motion is dEquatAng/dt, " + \
254 "so it gets large near the pole",
257 Px = parseDefs.Qualifier(
259 numValueRange = [1,1],
262 help =
"Parallax in arcseconds.",
265 RV = parseDefs.Qualifier(
267 numValueRange = [1,1],
270 help =
"Radial velocity in km/s, positive receding.",
273 Output = parseDefs.Qualifier(
275 numValueRange = [1,1],
277 help =
"The specified file is used for output.",
280 Full = parseDefs.Qualifier(
282 help =
"Certain items return more information if /Full is used."
285 class CoordSet(parseDefs.ValueParam):
286 def __init__(self, name, defValueList=(), help=
""):
287 parseDefs.ValueParam.__init__(self,
290 numValueRange=(0,
None),
291 defValueList=defValueList,
295 class CoordPair(CoordSet):
296 def __init__(self, name, extraHelp=""):
297 helpList = [
"""equatPos, polarPos [, equatVel, polarVel [, tai]]
298 Specifies equatorial position and, optionally, velocity and time, where:
299 - position is in degrees
300 - velocity is in degrees/sec; default is 0
301 - tai is TAI (MJD, seconds); default is the current TAI"""]
303 helpList.append(extraHelp)
304 CoordSet.__init__(self,
306 help=
"\n".join(helpList),
309 class CoordSys(parseDefs.KeywordParam):
310 def __init__(self, name, help, omit=()):
311 """Construct a CoordSys keyword parameter
313 @param[in] name name of parameter
314 @param[in] help help string for parameter
315 @paramm[in] omit: list of coordinate systems to omit (case blind)
317 omitSet = frozenset(str.lower()
for str
in omit)
318 parseDefs.KeywordParam.__init__(self,
321 keywordDefList = [kwd
for kwd
in _CoordSysList
if kwd.name.lower()
not in omitSet],
324 blockName = parseDefs.KeywordParam(
327 parseDefs.Keyword(name=
"AxeLim", help=
"axis limits and status bit flags"),
328 parseDefs.Keyword(name=
"Earth", help=
"earth orientation predictions"),
329 parseDefs.Keyword(name=
"Inst", help=
"instrument, rotator, guider and collimation parameters"),
330 parseDefs.Keyword(name=
"Obj", help=
"object (target) data, including position, " \
331 "offsets, refraction correction wavelength (both for the object and guiding) " \
332 "and computed values through mount position"),
333 parseDefs.Keyword(name=
"TelMod", help=
"telescope pointing model; warning: " \
334 "this uses a special format required by TPOINT"),
335 parseDefs.Keyword(name=
"Tune", help=
"performance tuning parameters"),
336 parseDefs.Keyword(name=
"Weath", help=
"weather data"),
338 help =
"Name of block (data structure)",
349 help =
"Command one or more axis controllers.",
352 parseDefs.KeywordParam(
355 parseDefs.Keyword(name =
"initialize", help =
"Reconnect (if disconnected) and initialize the axis controller. " + \
356 "Initializing an axis halts it and puts it into a state in which it can be slewed, if possible."),
357 parseDefs.Keyword(name =
"status", help =
"Get axis status"),
358 parseDefs.Keyword(name =
"stop", help =
"Stop the axis"),
359 parseDefs.Keyword(name =
"connect", help =
"Connect to the axis controller"),
360 parseDefs.Keyword(name =
"disconnect", help =
"Disconnect from the axis controller"),
362 help =
"What to do with the axis controller."
364 parseDefs.KeywordParam(
366 keywordDefList = [parseDefs.Keyword(name = item)
for item
in [
367 "azimuth",
"altitude",
"rotator",
"tel1",
"tel2",
368 "noAzimuth",
"noAltitude",
"noRotator",
"noTel1",
"noTel2"]
369 ] + [parseDefs.Keyword(name =
"all", passMeByDefault=
True)],
370 numParamRange = [0,
None],
371 help =
"Which axes? If omitted then all axes. tel1/tel2 is a synonym for azimuth/altitude.",
377 help =
"Send the command to all specified controllers, without checking to see if they exist.",
387 help =
"Broadcast a message to all users.",
390 parseDefs.ValueParam(
393 numValueRange=(1, 1),
394 help =
"Message to broadcast (a quoted string)",
400 valType = MsgTypeCodeDict.keys(),
401 numValueRange = [1, 1],
402 defValueList = (
"information",),
404 help =
"Message type (default is Information).",
414 CoordPair(name =
'fromCoords'),
417 help =
"Coordinate system from which to convert; Mount and None are not supported; " \
418 +
"default date is computed from 'fromCoords' time",
419 omit = (
"Mount",
"None"),
423 help =
"Coordinate system to which to convert; Mount and None are not supported; " \
424 +
"default date is computed from 'fromCoords' time",
425 omit = (
"Mount",
"None"),
429 Distance, PM, Px, RV,
432 help =
"Remove the effects of proper motion, radial velocity, and parallax to the current date " \
433 +
" (zpm stands for zero proper motion).",
436 name =
"useGSWavelength",
437 help =
"Use the guide star wavelength instead of the object wavelength for refraction correction.",
440 help =
"Convert a position from one coordinate system to another." \
446 help =
"Exit from the TCC command interpreter.",
454 parseDefs.ValueParam(
457 help =
"command for which you want detailed help",
459 parseDefs.ValueParam(
462 help =
"subcommand for which you want detailed help",
468 help =
"print full help about every command",
475 help =
"Command one or more mirror controllers.",
479 parseDefs.KeywordParam(
481 help =
"Mirror command",
483 parseDefs.Keyword(name =
"status", help =
"Return controller status"),
484 parseDefs.Keyword(name =
"initialize", help =
"Reconnect (if disconnected) and initialize the mirror controller. " \
485 "Initializing aborts the current command (if any) and stops motion (if any)."),
486 parseDefs.Keyword(name =
"connect", help =
"Connect to the mirror controller"),
487 parseDefs.Keyword(name =
"disconnect", help =
"Disconnect from the mirror controller"),
490 parseDefs.KeywordParam(
492 help =
"Which mirror(s) to command",
493 keywordDefList = [parseDefs.Keyword(name = item)
494 for item
in [
'primary',
'secondary',
'tertiary']] \
495 + [parseDefs.Keyword(name =
'all', passMeByDefault =
True)],
496 numParamRange = [0,
None],
499 qualifierList = [TimeLimit],
505 help =
"Offsets the telescope in various ways in position and velocity.",
508 parseDefs.KeywordParam(
511 parseDefs.Keyword(name =
"arc", help =
"Offset along great circle on sky (coordSys axis 1, 2, e.g. RA, Dec)."),
512 parseDefs.Keyword(name =
"boresight", help =
"Specify position of object on the " \
513 "instrument (in x-y axes of the instrument) (instrument x,y)."),
514 parseDefs.Keyword(name =
"instPlane", help =
"Old term for Boresight (instrument x,y)"),
515 parseDefs.Keyword(name =
"rotator", help =
"Rotator offset (1 axis)"),
516 parseDefs.Keyword(name =
"calibration", help =
"Local pointing correction (az, alt, rot)."),
517 parseDefs.Keyword(name =
"guideCorrection", help =
"Changes the guiding correction (az, alt, rot)."),
518 parseDefs.Keyword(name =
"gCorrection", help =
"Old term for GuideCorrection (az, alt, rot).")
523 help=
"""position and optionally velocity and TAI date (optional);
524 the format depends on the offset (because of varying #s of axes):
525 arc and boresight (aka instPlane) offsets have 2 axes:
526 pos1, pos2 [, vel1, vel2, [, TAI]]]
527 rotator offsets have 1 axis:
528 rotPos [, rotVel [, TAI]]
529 calibration and gCorrection offsets have 3 axes, though rotator is optional:
530 azPos, altPos [, rotPos [, azVel, altVel, [rotVel [, TAI]]]]
532 - position is in degrees; default is 0
533 - velocity is in degrees/sec; default is 0
534 - TAI is TAI date (MJD, seconds); default is the current date""",
539 "pAbsolute", help =
"position is absolute",
542 "pIncremental", help =
"position is incremental (the default)",
545 "vIncremental", help =
"velocity is incremental",
548 "vAbsolute", help =
"velocity is absolute (the default)",
551 "computed", help =
"offset using a computed slew (safer for long offsets)",
559 RestartQual(defValueList=(), helpIfOmitted=
"do not restart any axes"),
561 AbsRefCorrect(defBoolValue=
False),
562 RefCoefficients(defBoolValue=
False),
563 Collimate(defBoolValue=
False),
570 help =
"test if actor is alive",
577 help =
"Disable, enable or show the state of various background processes.",
579 parseDefs.KeywordParam(
581 keywordDefList = [parseDefs.Keyword(name = item)
for item
in [
'Disable',
'Enable',
'Status']],
583 parseDefs.KeywordParam(
585 numParamRange = [0,
None],
587 parseDefs.Keyword(name =
"BrdTelPos",
588 help =
"Broadcasts telescope position as UDP packets.",
590 parseDefs.Keyword(name =
"Collimate",
591 help =
"Controls the mirrors to adjust focus, collimation and scale.",
593 parseDefs.Keyword(name =
"Status", help =
"Regularly displays status.")
604 CoordPair(name =
"predCoords"),
606 name =
"predCoordSys",
607 help =
"coordinate system from which to convert; Mount and None are not accepted",
608 omit = (
"Mount",
"None"),
610 CoordPair(name =
"MeasCoords"),
612 name =
"measCoordSys",
613 help =
"coordinate system to which to convert; Mount and None are not accepted",
614 omit = (
"Mount",
"None"),
618 Distance, PM, Px, RV,
620 name =
"useGSWavelength",
621 help =
"Use the guide star wavelength instead of the object wavelength for refraction correction.",
624 help =
"Compute pointing correction from predicted and measured star position.\n\n" +
625 "Typical usage is to specify the predicted position in ICRS or similar " +
626 "and the measured position in GuideImage, GuideProbe or Instrument coordinates. " +
627 "Allowed coordinate systems include all except Mount and None.\n\n" +
628 "The time at which the conversion is performed is the time of MeasCoords," +
629 "which should be the time at the middle of the exposure",
636 help =
"Start or stop a batch job (e.g. snow). Warning: only one batch job may run at a time",
638 parseDefs.KeywordParam(
641 parseDefs.Keyword(name =
"run", numValueRange=[1,1], castVals = str,
642 help =
"Start the specified batch job.",
644 parseDefs.Keyword(name =
"stop", help =
"Stop the current batch job."),
645 parseDefs.Keyword(name =
"status", help =
"Show batch queue status."),
646 parseDefs.Keyword(name =
"list", help =
"List the batch jobs you can run."),
655 help =
"Disconnect from the TCC (a synonym for exit).",
662 help =
"Make the instrument rotator track the object, horizon, etc.",
664 parseDefs.ValueParam(
666 numValueRange = [0,3],
670 help =
"Rotator angle as pos [, vel [, time]], where pos is in degrees, vel in deg/sec and time is TAI (MJD seconds)",
672 parseDefs.KeywordParam(
675 parseDefs.Keyword(name =
"None", help =
"No rotation.", passMeByDefault=
True),
676 parseDefs.Keyword(name =
"Object",
677 help =
"rotAngle is the orientation of the object with respect to the instrument."),
678 parseDefs.Keyword(name =
"Horizon",
679 help =
"rotAngle is the angle of the horizon with respect to the instrument."),
680 parseDefs.Keyword(name =
"Mount",
681 help =
"rotAngle is the angle of the rotator in the coordinate system used by the rotator controller. "\
682 "Wrap preference is ignored (unlike other rotatation types)."),
688 AbsRefCorrect(defBoolValue=
False),
689 Collimate(defBoolValue=
True),
691 RefCoefficients(defBoolValue=
False),
692 RestartQual(defValueList=(
'rotator',), helpIfOmitted =
"restart the rotator"),
697 parseDefs.CommandWrapper(
700 parseDefs.SubCommand(
701 parseDefs.Keyword(name=
"block"),
704 paramList = [blockName],
705 qualifierList = [Input, NoRead],
706 help =
"""Set data in a block (data structure).
708 You may set the block from a file (using /input) or set individual entries from the command line.
709 All blocks except TelMod use the following standard format:
710 fieldName one-or-more-spaces-separated-values\n" \
711 where fieldName is not case sensitive. Leading whitespace is ignored and lines that begin with # are ignored as comments""",
713 parseDefs.SubCommand(
717 numValueRange = [0,1],
722 name =
"incremental",
723 help =
"Add the new focus offset to the existing focus offset, rather than replacing it.",
726 help =
"Changes the user-settable focus offset for the " \
727 "secondary mirror (microns), if a new value is specified. " \
728 "Then updates collimation (if tracking or slewing).",
730 parseDefs.SubCommand(
734 numValueRange = [2,2],
737 help=
"Set a new image center (specified in unbinned pixels) and adjust the pointing " + \
738 "of the telescope accordingly (by shifting the boresight). " + \
739 "The new center will persist until the next Set Instrument command.\n\n" + \
740 "Warning: if the new center is out of bounds (off the instrument) " + \
741 "then the command is rejected.\n\n" + \
742 "This command is intended for spectrographs whose slit positions are not repeatable. " + \
743 "Use Set ImCenter to set the center of the image to the center of the slit. " + \
744 "That way objects will be properly centered on the slit.\n\n" + \
745 "If the slit position is repeatable and you have multiple slits with different centers, " + \
746 "it is may be easier to set up a view data file for each slit and use " + \
747 "Set Instrument/GCView whenever you change slits.",
749 parseDefs.SubCommand(
753 numValueRange = [0,1],
754 help =
"Name of instrument (the current instrument if omitted)",
760 numValueRange = [1,1],
762 help =
"Specify the guide camera view (none if omitted)."
766 valType = [
'scaleFac',
'secFocus'],
767 numValueRange = [1,3],
768 help =
"""Specify which items to retain during the instrument change; omitted items are nulled. Valid values:
769 * SecFocus: focus offset for the secondary mirror
770 * ScaleFac: scale factor""",
775 help =
"Set the instrument: load new instrument data and adjust pointing accordingly. " + \
776 "If this command changes the current instrument then the rotator is halted.",
778 parseDefs.SubCommand(
782 numValueRange = [0,1],
785 help =
"Specifies the guide probe to use for pointing error correction.",
787 parseDefs.SubCommand(
791 numValueRange = [0,1],
794 help =
"Set the maximum number of users of the command interpreter." + \
795 " Warning: the limit is only checked when a user connects."
797 parseDefs.SubCommand(
801 numValueRange = [0,1],
806 help =
"If specified then new scale factor = old scale factor * value.",
810 help =
"Set the desired scale factor.",
812 parseDefs.SubCommand(
816 numValueRange = [3,3],
819 help =
"Set the intervals between status updates "\
820 "during tracking, slewing and when the telescope is doing neither.",
822 parseDefs.SubCommand(
827 help =
"Load earth orientation predictions from the current earth orientation prediction file.",
829 parseDefs.SubCommand(
834 parseDefs.KeywordParam(
837 parseDefs.Keyword(name =
"obj", numValueRange = [1,1], castVals=float),
838 parseDefs.Keyword(name =
"gStars", numValueRange = [1,1], castVals=float)
840 numParamRange = [0,
None],
847 parseDefs.SubCommand(
852 parseDefs.KeywordParam(
855 parseDefs.Keyword(name =
"airTemp", numValueRange = [1,1], castVals=float,
856 help =
"Outside air temperature, in C."),
857 parseDefs.Keyword(name =
"secTrussTemp", numValueRange = [1,1], castVals=float,
858 help =
"Secondary truss temperature, in C."),
859 parseDefs.Keyword(name =
"primF_BFTemp", numValueRange = [2,2], castVals=float,
860 help =
"Two measures of primary mirror temperature: " \
861 "Front temperature, back - front temperature difference, in C"),
862 parseDefs.Keyword(name =
"secF_BFTemp", numValueRange = [2,2], castVals=float,
863 help =
"Two measures of secondary mirror temperature: " \
864 "Front temperature, back - front temperature difference, in C"),
865 parseDefs.Keyword(name =
"pressure", numValueRange = [1,1], castVals=float,
866 help =
"Pressure in Pascals"),
867 parseDefs.Keyword(name =
"humidity", numValueRange = [1,1], castVals=float,
868 help =
"Fractional humidity (e.g. 0.2 for 20%)"),
869 parseDefs.Keyword(name =
"tLapse", numValueRange = [1,1], castVals=float,
870 help =
"Temperature lapse rate, in C/km"),
871 parseDefs.Keyword(name =
"wSpeed", numValueRange = [1,1], castVals=float,
872 help =
"Wind speed in m/s"),
873 parseDefs.Keyword(name =
"wDirection", numValueRange = [1,1], castVals=float,
874 help =
"Wind direction in degrees: S = 0, E = 90")
876 numParamRange = [0,
None],
879 qualifierList = [RefCoefficients(defBoolValue=
True), Collimate(defBoolValue=
True)],
885 parseDefs.CommandWrapper(
888 parseDefs.SubCommand(
889 parseDefs.Keyword(name=
"focus"),
890 qualifierList = [Full],
892 help =
"Show secondary focus offset.",
895 parseDefs.SubCommand(
896 parseDefs.Keyword(name=
"block"),
899 help =
"Show the specified block.",
903 qualifierList = [Output, NoRead],
906 parseDefs.SubCommand(
907 parseDefs.Keyword(name=
"axisConfig"),
909 help =
"Display config info about the axis controllers.",
910 qualifierList = [Full],
913 parseDefs.SubCommand(
914 parseDefs.Keyword(name=
"instrument"),
916 help =
"Display information about the current instrument.",
917 qualifierList = [Full],
920 parseDefs.SubCommand(
921 parseDefs.Keyword(name=
"maxUsers"),
923 help =
"Display the maximum number of users.",
924 qualifierList = [Full],
927 parseDefs.SubCommand(
928 parseDefs.Keyword(name=
"mount"),
930 help =
"Display the mount position of the main axes.",
931 qualifierList = [Full],
934 parseDefs.SubCommand(
935 parseDefs.Keyword(name=
"myNumber"),
937 help =
"Display your user ID number.",
938 qualifierList = [Full],
941 parseDefs.SubCommand(
942 parseDefs.Keyword(name=
"object"),
944 help =
"Display user-specified object position and related parameters.",
945 qualifierList = [Full],
948 parseDefs.SubCommand(
949 parseDefs.Keyword(name=
"physical"),
951 help =
"Display the physical position of the main axes.",
952 qualifierList = [Full],
955 parseDefs.SubCommand(
956 parseDefs.Keyword(name=
"ptErrProbe"),
958 help =
"Display the guide probe used for pointing error correction.",
959 qualifierList = [Full],
962 parseDefs.SubCommand(
963 parseDefs.Keyword(name=
"scaleFactor"),
965 help =
"Display the current scale factor.",
966 qualifierList = [Full],
969 parseDefs.SubCommand(
970 parseDefs.Keyword(name=
"status"),
972 help =
"Display information about the state of the TCC.",
973 qualifierList = [Full],
976 parseDefs.SubCommand(
977 parseDefs.Keyword(name=
"stInterval"),
979 help =
"Display the interval between status updates.",
980 qualifierList = [Full],
983 parseDefs.SubCommand(
984 parseDefs.Keyword(name=
"time"),
986 help =
"Display the current time in several time systems.",
987 qualifierList = [Full],
990 parseDefs.SubCommand(
991 parseDefs.Keyword(name=
"users"),
993 help =
"Display information about connected users.",
994 qualifierList = [Full],
997 parseDefs.SubCommand(
998 parseDefs.Keyword(name=
"version"),
1000 help =
"Display the version of the TCC control system software.",
1001 qualifierList = [Full],
1004 parseDefs.SubCommand(
1005 parseDefs.Keyword(name=
"wavelength"),
1007 help =
"Display the central wavelength for refraction correction for the object and the guide star.",
1008 qualifierList = [Full],
1011 parseDefs.SubCommand(
1012 parseDefs.Keyword(name=
"weather"),
1014 help =
"Display weather information.",
1015 qualifierList = [Full],
1023 help =
"Send a command directly to an axis or mirror controller.",
1026 parseDefs.ValueParam(
1029 numValueRange=(1, 1),
1030 help =
"Device: one of az, alt, rot (axis controllers), prim, sec, tert (mirror controllers).",
1032 parseDefs.ValueParam(
1035 numValueRange=(1, 1),
1036 help =
"The command to send. It must be in double quotes if it includes spaces."
1046 help =
"Make the telescope to slew to and track an object.",
1051 extraHelp =
"Nonzero velocity specifies dEquatAng/dt, dPolarAng/dt; " \
1052 "to track along a great circle specify /ScanVelocity or, " \
1053 "equivalently, specify an arc offset with nonzero velocity.",
1057 help =
"Coordinate system and date",
1058 omit = (
"Instrument",
"GProbe",
"GImage",
"PtCorr",
"Rotator"),
1070 parseDefs.Qualifier(
1072 valType = [
"object",
"horizon",
"physical",
"mount",
"none"],
1073 numValueRange = [1,1],
1074 help =
"""Type of rotation; choices are:
1075 * Object: rotate with the object. The rotator angle is the angle of the coordinate system of the object
1076 with respect to instrument x,y. For example if the object is specified in an RA/Dec coordinate system
1077 then at 0 degrees east will be along the x axis of the instrument, and at 90 degrees east will be along y
1078 (because east is the direction of increasing coordinate system axis 1).
1079 Warning: the orientation is specified at the un-arc-offset position (without arc offset taken into account);
1080 this allows drift-scanning to work, but may have surprising (not necessarily bad, just surprising)
1081 effects if you are using arc offsets for other purposes.
1082 * Horizon: rotate with the horizon. The rotator angle is the angle of the horizon with respect to the instrument.
1083 At 0 the horizon (direction of increasing azimuth) lies along the x axis of the instrument;
1084 at 90 the horizon lies along the y axis. Obtaining good results while rotating with the horizon
1085 equires great care: read the note for details. Note: unlike object rotation,
1086 horizon rotation is specified at the net object position, with arc offsets included.
1087 * Mount: the rotator angle is directly sent to the instrument rotator. No wrap is applied.
1088 Use Mount rotation to put the instrument rotator to a known position.
1089 * Physical: similar to mount but wrap may be applied, and there may be difference in scale or offset.
1090 Physical is deprecated.
1091 * None: do not rotate.""",
1093 parseDefs.Qualifier(
1094 "rotAngle", numValueRange = [1,3],
1095 valType = float, help =
"Set the angle of rotation: pos [vel [TAI]].",
1099 AbsRefCorrect(defBoolValue=
True),
1100 Collimate(defBoolValue=
True),
1102 RefCoefficients(defBoolValue=
True),
1103 RestartQual(defValueList=(
"all",), helpIfOmitted=
"restart all axes"),
1104 parseDefs.Qualifier(
1107 'arcOffset',
'boresight',
'gCorrection',
'calibration',
1108 'noArcOffset',
'noBoresight',
'noGCorrection',
'noCalibration',
1110 numValueRange = [1,
None],
1111 help =
"""Retain the specified offsets or zero them?
1112 * /Keep=<OffsetName> keeps the offset (both position and velocity)
1113 * /Keep=No<OffsetName> zeros the offset (both position and velocity)
1114 Valid offset names are:
1115 * ArcOffset: object arc offset
1116 * Boresight: boresight offset (also known as instrument plane offset)
1117 * GCCorrection: net guiding correction
1118 * Calibration: calibration offset
1119 The default behavior for all offsets except calibration is to zero them if a new object is specified, else keep them.
1120 The default behavior for calibration offsets is to keep the position component and zero the velocity component
1121 (which is almost always 0 anyway), regardless of whether a new object is specified.""",
1123 parseDefs.Qualifier(
1125 numValueRange = [0,
None],
1131 help =
"""Start or end a pointing error sequence; the default behavior is to
1132 save the current target, find a position reference star near the target, and slew to center the reference star
1133 in the pointing error guide probe (as designated in the inst block). The following options can alter
1135 * NoFindReference: use the target as the position reference star instead of finding one in the position reference catalog
1136 * NoRefSlew: do not slew to the reference star
1137 * ObjSlew: slew back to the target that was saved by the last Track/PtErr command (and the saved target
1138 is cleared). This option may not be specified with NoFindReference or NoRefSlew.
1141 parseDefs.Qualifier(
1143 numValueRange = [2, 2],
1145 help =
"""magnitude range for reference stars found with Track/Pterr. The order of the two values doesn't matter
1146 (in order to avoid confusion between smaller values and fainter stars).
1147 If omitted, then defaults to target magnitude +/- 2, if known, else (3, 7).
1150 parseDefs.Qualifier(
1152 numValueRange = [2, 3],
1154 help =
"Scan along a great circle. Values are equatSkyVel, polarVel [, TAI], " + \
1155 "where equatSkyVel is velocity on the sky (dEquatPos/dt * cos(polarPos)) " + \
1156 "and tai defaults to the current date (or to the date of coordPair, if specified). " + \
1157 "Works by setting arc offset to 0, 0, equatSkyVel, polarVel, tai; " + \
1158 "thus if /scanVelocity is specified, /keep=[no]arcOffset is ignored.",
1160 parseDefs.Qualifier(
1161 "chebyshev", numValueRange = [1,1], valType = str,
1162 help =
"Track an object whose position is specified by Chebyshev " +
1163 "polynomials of the first kind, as a function of TAI date.",
1169 CmdParser.__init__(self, tccCmdList)
A class that holds command definitions, and can parse tcc commands.
def __init__
Construct a tccCmdParser.