command name/flags(type
name, ...[type name, ...]) {commands}
Create a new command.
name
/flags
type name
[type name,...]
command delay(Interval dt) {
until $elapsed >= $dt
}
delay 10m
command track_source/wait/warn(Source src) {
# If the source is currently below the horizon, and the
# caller has asked to be told about this, output a warning.
if($warn & $el($src) < 0.0) {
print "Source ", $src, " is currently below the horizon."
}
# Tell the control system to track the source.
track $src
# If the caller wants us to wait until the source is acquired before
# returning, do so here.
if($wait) {
until $acquired(source)
}
}
This command can then be called like:
track_source/warn marsin which case
$warn would be true and $wait
would be false, or
track_source/warn/wait moonto make both
$warn and $wait true, or
track_source mercuryto make both
$warn and $wait false.
command offset_track(Source src, [PointingOffset az, PointingOffset el,
PointingOffset dk]) {
offset az=$az, el=$el, dk=$dk
track $src
}
This command has one mandatory argument, followed by 3 optional
arguments. The optional arguments are passed to the builtin
"offset" command, where only the arguments that
are presented to the offset_track command actually become
arguments of the offset command. To be more precise, if
the optional $az argument is omitted when calling
offset_track, the corresponding optional $az argument of
the offset command will be assigned a nul value. For example:
offset_track moon, az=0:0:5, el=0:0:10would result in the
offset command installing new
tracking offsets for azimuth and elevation, but would leave the deck
angle offset unchanged.