Next: HST NICMOS Residual Bias Removal Techniques
Up: Software Applications
Previous: A Flexible Object Oriented Design for Page Formating
Table of Contents - Subject Index - Author Index - Search - PS reprint - PDF reprint

{\v{S\/}}koda, P, Honsa, J., & {\v{S\/}}lechta, M. 2001, in ASP Conf. Ser., Vol. 238, Astronomical Data Analysis Software and Systems X, eds. F. R. Harnden, Jr., F. A. Primini, & H. E. Payne (San Francisco: ASP), 423

The Stellar Spectra Acquisition, Reduction, and Archiving Systems at the Ond{\v{r\/}}ejov Observatory 2-meter Telescope

Petr {\v{S\/}}koda, Jaroslav Honsa, Miroslav {\v{S\/}}lechta
Astronomical Institute of the Academy of Sciences of the Czech Republic, 251 65 Ond{\v{r\/}}ejov, Czech Republic


The 2-meter telescope of the Ond{\v{r\/}}ejov Observatory near Prague is a middle-class instrument fully devoted to high dispersion stellar spectroscopy. The data are produced by two acquisition systems of different generations. The older linear detector Reticon 1872 AF is controlled by a DOS program providing quick-look display capability as well. The second is a CCD driven by a stand-alone Linux program. The quick-look is provided by SAOimage or XImtool through data pipes. An easy access to both the raw and reduced data is provided by a simple WWW-based archiving system.

We give a basic overview of these systems and software methods used for their communication with the spectrograph control system.

1. Scientific Instruments

The 2-meter telescope built by Carl Zeiss, Jena, was put into operation in 1967 and since the beginning it was devoted to high dispersion spectroscopy of early-type (mainly Be) stars in its 64-m coudé focus. The plate archive of the 2-m telescope contains almost 6000 spectral plates exposed until the beginning of year 1993, when the Reticon AF1872 detector was commissioned. Using it, more than 4000 stellar spectra were secured, giving with calibrations a total of 16600 frames until the end of the year 2000. The Reticon was then replaced by a new CCD camera with ISA $2000\times800$ chip.

2. The Spectrograph Control System Overview

All detectors are installed in the coudé spectrograph which can operate either with the 700mm or the larger 1400mm camera. In the summer of 1998 the old-fashioned manual control was replaced by a new microcontroller-based system which takes care of a number of controlled devices:

Flat field lamp - to switch on the projector flat.
Flat field mirror - to tilt the mirror into the lightpath.
Comparison arc lamp - to switch on the ThAr lamp.
Comparison arc mirror - to tilt the ThAr lamp mirror into the lightpath.
Grating - to set desired angle by AC motor, measuring by incremental angle encoder, two limit sensors.
Slit - to set desired slit height by stepping motor, two limit sensors, the position must be reset by driving to the limit sensor.
Collimator mask - to set desired mask (open, close, open-left, open-right) by rotating mask wheel by AC motor, optical encoders are used to recognize masks.
Dichroic mirrors - to set desired dichroic mirror by rotating wheel with mirrors by stepping motor, optical encoders are used to recognize actual position.
Spectral filters - to set desired filter by rotating filter wheel by stepping motor, optical encoders are used to recognize actual position.
Focusing the 700mm and 1400mm camera - to set desired position by stepping motor, two limit sensors.
Correction plate for 700 or 1400mm camera - read-only signal to distinguish the plate position (in beam, out of beam, intermediate).
Exposure-meter - to start/stop counting pulses from photo-multiplier, to measure frequency (per second) and sum of pulses during exposure, to zero this sum.

The spectrograph control system is based on these ideas:

2.1. Server for Communication with Spectrograph Driver Units

The server runs as a daemon on the control computer and is started at system startup. After startup the server forks into two processes:

This configuration has several advantages. The server itself knows at every moment the status of controlled devices and can send the answer immediately to a client; the spectrograph may be controlled from any computer which is connected to Ethernet and is allowed to do so; the client can be linked to various programs and so it can extend their functions; and several clients can run at the same time, some of them only monitoring the status of the spectrograph. The only disadvantage is that it does not work for DOS machines.

2.2. Client-1 - Monitor and Control Program of Spectrograph

This program shows the status of all controlled spectrograph devices and allows the user to control them. The program is written in Tcl/Tk. The client part for communication with the server is written in C as a set of functions compiled as shared libraries by SWIG. This organization radically simplifies the design of new monitor and control programs since the routine work of making a TCP/IP connection to a computer, reading data from it, sending data to it, or closing the connection is reduced to only four Tcl-like functions. Using these functions is enabled by a load command at the beginning of a Tcl program.

2.3. Client Part of a Program Controlling CCD

The client for communication with the server is included in a large program which controls the CCD. A function which establishes a UDP connection to the server is called at the start of the program and at the end, after quitting other functions, and closes the connection. The function for getting data from the server is periodically called in a loop during the execution of the program. It displays the status of the CCD. The function for sending commands to the spectrograph is called whenever the CCD needs a change of status of a spectrograph device. The program then waits for the finish of the change--it is sometimes unpleasantly time demanding.

The function for reading data from the server must be designed to anticipate possible failure of the UDP connection. The wait for a reply after sending a request for data is limited by a timeout. The timeout is made by a system call of the alarm() function.

2.4. Spectrograph DOS Driver

The reticon 1872 AF detector is controlled by a home-made ISA card (containing PIO 8255 and timer 8253) and driven by the program creticon, which was written in Turbo Pascal 5.5 and contains time-critical code for the synchronous Reticon readout. This was achieved by disabling interrupts, including waiting loops and direct reading I/O port with embedded assembler commands. Most critical and time-consuming was the tuning of the loops to fit the particular computer's ( alkaid) speed and compiler options.

As this program cannot easily be replaced due to its complexity (it is also taking care of the target star catalogues, maintaining the observing logs, providing the simple debiasing and flat-fielding, as well as the quick-look display and many more services). We decided to change only several small routines that make the very calls to hardware. As the new spectrograph controlling computer mizar is a stand-alone Linux machine connected to the ethernet network, we needed an easy way of reading the status of devices and sending them commands over the network without the need of fundamental changes in the code. The solution we have developed is quite tricky:

The quite interesting result of this setup is the speed of status updates though NFS--more than 250 readouts per second. The unique counter is very good for timeout control in case the communication is broken.

3. Data Reduction and Analysis Software

At present the most important data for the current research at Ond{\v{r\/}}ejov are the Reticon electronic spectra. They are small (about 4kB) and quite simple to handle. For the basic reduction and analysis of these data a proprietary program SPEFO written by J. Horn has been used for years in the stellar department.

The new spectra from the CCD detector (about 3MB per image) are processed by standard packages in IRAF. All the necessary FITS headers are provided by the data acquisition software.

4. Data archiving

In order to be able quickly find the detailed information about the exposure of a particular spectrum (plate or Reticon file) a SQL-based archive of observing logs has been under development in the Stellar department. Its preliminary version is based on the free RDBMS PostgreSQL and a Web interface, WDBI, is accessible on the 2-m telescope home page.

The raw data will not be available on-line (due to its specific nature as a result of long-term monitoring observation) but those interested may contact the staff of the stellar department by e-mail to


This work was partially supported by the Ministry of Education, Youth and Sports of the Czech Republic (grant LB98251).

© Copyright 2001 Astronomical Society of the Pacific, 390 Ashton Avenue, San Francisco, California 94112, USA
Next: HST NICMOS Residual Bias Removal Techniques
Up: Software Applications
Previous: A Flexible Object Oriented Design for Page Formating
Table of Contents - Subject Index - Author Index - Search - PS reprint - PDF reprint