The Telescope Scheduling Language.

If this is your first encounter with the language, please read:

A Tutorial Introduction to the Language

Similarly, before driving the telescope, please read:

Driving the 40m telescope

For information about updating the pointing model, please read:

Updating the 40m pointing model

The rest of this page contains links to reference information.


Miscellaneous information


Control program configuration commands.

archive [combine=number, dir=/whatever, filter=true|false]
Configure the data archiver.
close archive|log
Close the current archive or log file.
catalog filename
Load sources from a source catalog file.
flush archive|log
Flush buffered data to the current archive or log file.
horizon elevation
Specify the horizon that is to be assumed by the show command.
logdir directory
Tell the control program where to put subsequent log files.
open archive|log, [dir=?]
Open a new archive or log file.
add_signals {signal_names}
Define the list of signal names.
site longitude, latitude, altitude
Set the location of the telescope.
ut1utc filename
Load an ephemeris of UT1-UTC.

Hardware configuration commands.

acquisition_pars axes, max_dist, holdoff
Configure target-acquisition detection parameters.
axis_limits/hard az_margin, el_margin, {limit_regions}
Specify the limits of the telescope axes.
azimuth_overlap turn1_state, axis_start_az, switch_start_az, switch_end_az, axis_end_az
Configure the azimuth overlap.
cal_az_el az_offset, el_offset
Specify pointing model azimuth and elevation corrections.
cal_collimation collim
Specify the measured collimation offset of the feed.
cal_flexure flexure
Specify the measured gravitational flexure of the feed tower.
cal_tilt_meter af_offset, af_scale, lr_offset, lr_scale
Calibrate the azimuth tilt meter.
cal_wind_flexure twind_flex
Specify the wind-loading flexure of the telescope.
conf_tilt_meter af_offset, af_scale, lr_offset, lr_scale, stime
Configure the azimuth tilt meter.
encoder_counts axes, counts
Specify the directional number of counts per turn of axis encoders.
encoder_offset axes, offset
Specify the topocentric angle that corresponds to zero encoder count.
focus
Focus the receiver according to the elevation and ambient temperature.
focus_curve f10,f20,f30,f40,f50,f60,f70,f80,f90
Specify how the focus distance changes with elevation.
focus_drive_pars offset, scale, timeout, max_try
Configure the servo parameters of one or more telescope axes.
focus_tcurve range, tmin, tmax, f10,f20,f30,f40,f50,f60,f70,f80,f90
Specify how the focus distance changes with elevation at a given temperature.
focus_tolerance tolerance
Specify the default focus-distance tolerance.
grav_tilt north, east
Specify the inclination between gravity and the geocentric vertical.
halt_pars axes, halt_speed, halt_timeout
Configure parameters that are used when halting telescope axes.
overspeed_pars axes, mean_factor, jump_factor
Configure overspeed detection parameters.
servo_pars axes, track_vmax, slew_speed, slew_volts, pgain, igain, dgain, vgain, zero_offset, accel_lim
Configure the servo parameters of one or more telescope axes.
stow_pars az, el
Configure the running parameters of software mediated stows.
tilt_meter [on=false|true, limit=?]
Specify how and if the azimuth tilt meters should be used.
underspeed_pars axes, holdoff, min_fract, jitter
Configure underspeed detection parameters.
weather [url=?, interval=?]
Configure the parameters that control weather-station readouts.
wind [stow_speed=?, stow_gust=?, unstow_speed=?, unstow_gust=?, hold_time=?, hold_inc=?, update_timeout=?, change_timeout=?, enable=?]
Configure automatic stowing and unstowing of the telescope due to wind.

Engineering Commands

reboot cpu|rtc|telcontrol
Restart the control system.
load_reboot_script filename
Load a schedule script to be run whenever the real-time cpu reboots.
shutdown cpu|rtc|telcontrol
Halt the control system.

Scheduling inquiry functions.

Boolean after(time, utc|lst)
Return true if the current time is after a given time-of-day.
Boolean acquired(operations)
Return true if a specified set of operations has completed.
Boolean between(start, end, utc|lst)
Return true if the current time is within a given window of time.
Boolean drives_available()
Return true if the telescope drives are available to be enabled for observing.
Boolean drives_enabled()
Return true if the telescope drives are enabled for observing.
Double elapsed()
Return the time spent within the enclosing loop or until statement.
Count iteration()
Return the number of completed iterations of an enclosing loop.

Parameter query functions.

Count archiving_interval()
Return the current archiving interval.

Schedule Control Commands.

advance_schedule index number
Move a schedule one or more entries towards the front of the schedule queue.
abort
Terminate statements out to an enclosing "catch $aborted()" statement.
aborted()
Use this in catch statements to catch and handle command execution errors.
abort_schedule
Abort the schedule that is currently running.
cancel command
Terminate a running user-defined command by name.
catch condition {statements} {remedial_commands}
Abort the specified block of commands if the given condition becomes true.
check_schedule filename(arguments)
Check wether the specified schedule would be accepted by the schedule command.
remove_schedule index
Remove a given schedule from the schedule queue.
resume_schedule
Resume execution of a paused scheduling script.
retard_schedule index number
Move a schedule one or more entries towards the back of the schedule queue.
restart_schedule
Restart the currently running schedule, if any.
schedule filename(arguments)
Add a schedule to the list of pending schedules.
signal/send|init|clear name
Send a signal to a running schedule.
Signal signaled(signal)
Check whether a given signal has been sent by the user.
suspend_schedule
Temporarily suspend execution of the schedule that is currently running.

Telescope Control Commands.

axes axes
Enable specified telescope axes, and disable the rest.
halt
Decelerate the telescope to a halt as quickly as possible.
offset/add [az=?, el=?, ra=?, dec=?, x=?, y=?]
Change the temporary tracking offsets.
power_drives
Restore power to the telescope drives after a power failure.
service
Send the telescope to the service position under hardware servo control.
set_focus position
Attempt to change the focus position of the receiver.
stow/soft
Send the telescope to the stow position.
slew [az=?, el=?]
Slew one or more axes of the telescope to given positions.
track source
Start tracking a given source.
check_wind
Terminate a wind-stow early if the wind conditions are currently okay.
Boolean focus_acquired()
Return true if the latest focusing operation succeded.
Double focus_position()
Return the most recently reached focus position.

Generic Receiver Control Commands.

disable device
Deactive a specified external device.
enable device
Enable and activate a specified external device.
tell device, command
Send an arbitrary command string to a miscellaneous external device.
request_flux device, type, pol, dt
Request that a specified receiver integrate and send back a flux.
FluxReply requested_flux()
Return the flux of the latest reply to a request_flux command.

Receiver-specific commands

kuband
Ku-band receiver commands and other information.

Miscellaneous Inquiry Functions.

Double azimuth(source)
Return the current azimuth of a given source.
Date date()
Return the current date and time (UTC).
Double declination(source)
Return the declination of a given source.
Double elevation(source)
Return the current elevation of a given source.
PointingFit fit_pointing(hpbw, bg_flux, trials)
Fit a guassian beam to the fluxes and offsets of a list of trial pointings.
FitPointSource fit_point_source(x_hpbw, y_hpbw, samples)
Fit for the offset position and flux of a point source.
QuadFit fit_quadratic(trials)
Fit a quadratic to the fluxes measured at various trial offset positions.
Date rise_date(source,utc,horizon)
Return the nearest date and time at which a given source rises.
Boolean rising(source)
Return true if a specified source is currently rising.
Double separation(source1, source2)
Return the current separation between two sources.
Date set_date(source,utc,horizon)
Return the nearest date and time at which a given source sets.
Boolean setting(source)
Return true if a specified source is currently setting.
Double sky_to_az(el, angle)
Return the azimuth offset that corresponds to a given great-circle distance.
Double sky_to_ra(dec, angle)
Return the Right Ascension offset that corresponds to a given great-circle distance.
Double sky_to_time(dec, angle, utc|lst)
Return how long a source takes to drift across a given great-circle distance.
Double time(utc|lst)
Return the current time of day on a given time-scale.
Date today()
Return today's date (0h UTC).
Date tomorrow()
Return tomorrow's date (0h UTC).
TrackingOffsets tracking_offsets()
Get the current tracking offsets.
Boolean visible(source)
Return true if a specified source is currently above the horizon.

Miscellaneous Inquiry Commands.

show source, [utc=?, horizon=?]
Display contemporary information about a source.

Miscellaneous Commands.

alarm message
Trigger the telviewer alarm.
label text
Tag subsequent frames in the archive with a specified string label.
mark one|add|remove, features
Change the set of feature markers to be recorded in the archive.
record_misc slot, values, [scale=?]
Record one or more values in the mount.frame.misc register.

General Scripting Commands and Functions

at_end {statements}
Register statements to be invoked when a procedure or script ends.
break
Prematurely exit the innermost enclosing foreach or while loop.
exit
Terminate execution of the containing script.
<datatype> name = value
Create a new scalar variable and give it a value.
command name(type name, ...) {commands}
Create a new command.
do datatype variable=start,stop,increment {commands}
Repeatedly run a set of commands while stepping the value of a local variable.
foreach(type name) list {commands}
Loop through a set of commands once for each member of a list.
PrintDouble format_double(format, value)
Return the combination of a double value and its printing format.
function type name(type name, ...) {expression}
Create a new function.
if(clause) {commands} else if(clause) {commands} else {commands}
Conditionally execute one of a number of blocks of commands.
ifhost(clause) hostname1 {commands} hostname2 {commands} {commands}
Conditionally execute commands that are specific to given telcontrol hosts.
import filename
Import the contents of another script.
listof type name = {value, ...}
Declare a new variable and initialize it with a list of a given type.
log "string" | $datatype(expr) | $function(args) | $variable
Record a message in the log file and send it to control clients.
next
Prematurely start the next iteration of the innermost loop.
print "string" | $datatype(expr) | $function(args) | $variable
Print one or more arguments according to their types.
return
Finish executing the enclosing command without executing any of its remaining statements.
group name {type name, ...}
Create a new aggregate datatype.
until clause
Halt script execution until the given boolean clause becomes true.
while(clause) {commands}
Repeatedly run a set of commands while the given boolean clause is true.

Built-in signals.

The following list of signals indicates the event that causes them to be sent to the current schedule. See the documentation of the signal() function to understand how to catch and clear such signals.
source_set
The source being tracked went below the lower elevation limit.
suspended
The current schedule was suspended.

Environment variables.

hostname
The name of the computer that is running telcontrol.

Datatypes.

AcquireTargets
A selection of ongoing transactions.
ArcFile
An archive file type (archive or log).
Axes
A set of telescope axes.
AxisLimits
The starting azimuth and elevation limits of an azimuthal limit region.
Boolean
A truth or false value.
Count
A positive integral count.
Date
A Gregorian date and time (UTC).
DoubleFormat
The datatype used for specifying the printing format of a Double variable.
Double
A generic signed floating-point datatype.
EncoderCount
An encoder count.
Features
A set of markers that indicate features of interest in an archive frame.
FluxReply
A return value of the requested_flux() function.
FluxType
The type of a flux.
FocusCurveId
The identifier of a focus curve installed by the focus_tcurve command.
InputFile
The pathname of a readable file.
Integer
A generic signed integer.
HttpUrl
An HTTP URL.
Keyword
An unquoted case-insensitive keyword string.
OffsetMode
Is used to specify how new pointing offsets modify existing ones.
PolType
A polarization specification.
PointingFit
A return value of the fit_pointing() function.
PointSourceFit
Return values of the fit_point_source function.
PointSourceSample
The received power of a point source at a specified x,y offset position.
PrintDouble
The combination of a Double value and a DoubleFormat format.
QuadFit
A return value of the fit_quadratic() function.
QueueEntry
The index of a script within the schedule queue.
ReceiverCmd
An arbitrary command string to be sent to a miscellaneous external device.
ReceiverName
The name of a miscellaneous external device.
Script
The pathname and arguments of a scheduling script.
Sexagesimal
A generic signed floating-point datatype expressed in sexagesimal.
Signal
A signal name.
Source
A source from the source catalog.
String
A literal string.
SwitchState
The on or off state of a switch.
SysType
The target subsystem of a reboot or shutdown.
TimeScale
A timescale specifier (UTC or LST).
TrackingOffsets
Tracking offsets returned by the tracking_offsets() function.
TrialPosition
The flux and its uncertainty at a specified offset position.
Wdir
The pathname of a writable directory.

Martin Shepherd (Last change: 20-May-2010)