Tcl/Tk in Astronomy: an Informal and Incomplete Survey
Tcl/Tk in scientific research is almost a well-kept secret.
In astronomy as in other fields, people tend to work very hard
on large projects for long periods, without the opportunity
to take a breather and find out what everyone else is doing.
Also, many software products written for scientific applications
are so specific to a physical installation or a research program
that they have little re-use potential even for others in
the same field.
So no one really knows how much Tcl/Tk code is supporting
the international world of astronomy and astrophysics. For
theoretical computation and pipeline data reduction, we know
that languages like Python and IDL are popular. Where Tcl
and Tk show up is where you would expect: in the production
of complicated, customized user interfaces of every kind:
interfaces to images, instruments, telescopes, log files,
and similar operational systems.
To collect the pictures shown here I simply hunted around
the Web a little, wrote to a few colleagues personally, and
of course most easily found applications written at my own
institution :-) I suspect that this is a very small subset
of the real body of Tcl/Tk code in the service of astronomy
These screenshots run the gamut from infrastructure (the
building and debugging of CCD controllers) to data gathering
(instrument and telescope control) to data reduction
(both pipeline and interactive). If you are curious about
the projects casually mentioned here, follow the URLs
and find out who's looking at the sky and why.
Stuff from Lick Observatory
- DTAKE configuration explorer
- The configuration files for the DTAKE data taking code
used on Mt Hamilton for older Lick instruments is like a
maze of twisty little files all including each other. This
GUI was written to help the software engineer untangle
the maze and configure the software correctly. This
is Tcl/Tk in a search/parse tool with tree visualization.
Part of the
Detector Lab effort headed by
- CCD Controller Design
- There are lots of clocks and signals on our
custom CCD controller boards which "tune" the boards
for various specific devices. Configuring all these
clocks is a complicated problem, and Richard has
written this handy GUI which allows the developer
to see and edit the timing and related signals
for a controller. This is Tcl/Tk in a numeric
visualization tool for multivariate data.
- Controller Testing
- After the controller is fully configured it
has to be tested. This is one test harness
interface which permits the user to twiddle bits
in registers on the controller boards, etc.
This is Tcl/Tk in the realtime hardware realm.
Also by Richard Stover.
- Nassign view 1 and
- One of the instruments on Mt Hamilton is AMOS
(A Multi-Object Spectrograph). This is a spectrograph
which uses many optical fibers to place the light from
objects in the sky onto a detector. The Nassign
utility allows the scientist to explore different
fiber positioning setups and save them for use during
real observing. This is not a simple problem, nor
(as you can see) is it a simple GUI! Here we have
a more graphical or animated view of numeric
configuration data, one which mimics the actual
physical layout of the target hardware. Written by
- ESI Spectrograph Control GUI
- A modern astronomical instrument is like a very
complicated semi-robotic camera. The observer (astronomer)
needs some kind of "control panel" to set up and use
the instrument during the observing night. Lick uses
Dashboard, a Tcl/Tk application for building instrument
GUIs, for several instruments: PFCAM, ESI, and the
forthcoming DEIMOS. Here we are not mimicking the
actual layout of the horribly complicated target
hardware, but presenting a schematic or conceptual
visual model of a real-time system. Written by
the ESI homepage and De's
- Instrument Telemetry
- Both during final QA testing and after the instrument is
commissioned, we have to determine whether it is working as
we expected. There are hundreds of telemetry values from
the motors, temperature sensors, power supplies and so forth,
which comprise the whole instrument. DataMynah is a
pseudo-intelligent, pseudo-NL tool which permits engineers
to delve into the mass of telemetry data and quickly get
timeline plots showing instrument performance for any
period of interest. Also written by De Clarke.
Cool Astro Applications from Other Sites
- Controlling Telescopes with Tcl/Tk
- UCO/Lick routinely controls instruments with GUIs
written in Tcl/Tk, but our telescope and dome control
systems (mostly older) tend to have old C/Xt type
GUIs. The recent Gemini project, however, controls its twin
8-meter telescopes with a graphical Tcl/Tk interface
Here you see both conceptual and physical representations
of underlying systems on the same canvas.
- Plotting Data from the 2dF Survey
- The 2dF Survey
is one of the largest astronomy projects in recent years.
It's an enormous effort producing enormous quantities of
data. This is one little Tcl/Tk plot widget used in the
data reduction process. See also
Documentation on the DRAMA instrument software development
environment at AAO, which includes a Tcl extension.
- Pipeline Data Reduction for 2dF
- When massive amounts of data are produced quickly by
large modern astronomical instruments, there's no way
to reduce the incoming flood without some automation.
Data reduction pipeline software is increasingly important
in modern astronomy. This is the GUI for the 2dF data
reduction pipeline, which permits an operator to supervise
and configure the reduction process. Both these 2dF images
come from a
recent paper on the 2dF project.
- Starlink GWM Image Display Widget
- The fundamental problem of most astronomy is how to
display gathered images (direct or spectral) intelligently,
so the observer can get some meaning out of the bits.
Astronomical images are not saved in widely-used formats
like PNG or TIFF, but in a format called
So astronomical institutions need specialized image display tools
to handle the FITS format and the complex, semantically-rich
image headers it permits. This is one such display tool,
implemented as a Tk extension by
at the Rutherford Appleton Laboratory
for the Starlink project.
- GAIA Starlink data reduction GUI
- Just displaying the image is not enough. The observer
needs a cartload of tools for manipulating and analyzing the
image, so a real data reduction tool consists of an image
viewer widget such as GWM, wrapped in a frame full of menus,
pan views, zoom views, buttons, crosshairs, realtime pixel
value readouts, etc. This is one such image reduction
GUI currently maintained by
See note (1) at bottom of page!
- DS9 CFA Data Reduction GUI
- In the US, a popular image reduction tool called
SAO has evolved steadily over the last several years;
eventually (version "SAOtng") its image display became
a Tk widget (SAOtk), and the current beta version is
DS9, written by
Bill Joye at
CFA Harvard. UCO/Lick will probably use DS9 for the
complicated images produced by the DEIMOS instrument.
The UC Regents don't care if my code works for you or not, so there are no
guarantees. Read the COPYRIGHT statement on anything you download from us.
Everything you get from us is free. As software ought to be. :-)
The image shown with GAIA is M51 from the ESO DSS server,
from NGS-POSS (Palomar sky survey) funded by a gift from the
National Geographic Society to Cal Tech, digitized and
compressed at STScI (Space Telescope Science Institute)
under US Government grant NAG W-2166; the image is
copyright AURA 1994. The lawyers made me say
all this :-)
University of California
Santa Cruz, CA 95064
Tel: +1 408 459 2630
Fax: +1 408 454 9863