Next: WCSTools: An Image Astrometry Toolkit
Up: Software Systems and Tools
Previous: The STSDAS Table Selector Library
Table of Contents - Subject Index - Author Index - Search - PS reprint - PDF reprint

Jenness, T., Economou, F., Tilanus, R. P. J., Best, C., Prestage, R. M., Shimek, P., Glazebrook, K., & Farrell, T. J. 1999, in ASP Conf. Ser., Vol. 172, Astronomical Data Analysis Software and Systems VIII, eds. D. M. Mehringer, R. L. Plante, & D. A. Roberts (San Francisco: ASP), 494

Perl at the Joint Astronomy Centre

Tim Jenness, Frossie Economou, Remo P. J. Tilanus1, Casey Best2, Richard M. Prestage, Pam Shimek2
Joint Astronomy Centre, 660 N. A`oh{\={o\/}}k{\={u\/}} Place, Hilo, HI 96720

Karl Glazebrook, Tony J. Farrell
Anglo-Australian Observatory, P.O. Box 296, NSW 2122, Australia

Abstract:

Perl is used extensively at the JAC (UKIRT and JCMT) and because of the language's flexibility (enabling us to interface perl to any library) we are finding that it is possible to write all of our utilities in it. This simplifies support and aids code reuse (via the module system and object oriented interface) as well as shortening development time.

Currently we have developed interfaces to messaging systems (ADAM and DRAMA), I/O libraries (NDF, GSD), astronomical libraries (SLALIB) and the Starlink noticeboard system (NBS). We have also developed tools to aid in data taking (the JCMT observation desk) and data processing (SURF and ORAC-DR)

This paper will briefly review the facilities available, with an emphasis on those which might be of interest to other observatories.

1. Introduction

At JAC, we make extensive use of the perl language, beyond its popular uses in system administration and web authoring. Described as the ``Swiss Army Chainsaw'' of computing, the language's power and versatility provides appropriate solutions to a wide range of problems.

Here we describe some of the utilities and libraries we have developed and will be making available to the astronomical community. A web-site is currently being developed that will act as a repository for astronomical software written in perl (http://astro.perl.org).

2. Data Reduction

Perl has been used extensively to help with data reduction at the JAC. The ORAC-DR data reduction pipeline has been developed as a modular extensible pipeline system that can be used to reduce data from any instrument or telescope with only minor changes to the infrastructure. This has been achieved by using perl object-oriented programming and the ability to generate data reduction code on-the-fly but executed by the current perl interpreter in a specified namespace. More information on the ORAC-DR data reduction pipeline can be found in Jenness & Economou (1999).

The SCUBA data reduction package (SURF) (Jenness & Lightfoot 1998) has also made use of perl in order to simplify some tasks for log generation, file header manipulation and automated data reduction.

3. Observation Planning

Perl/Tk is now the standard GUI language at the JAC. We are using it primarily in developing applications to aid in the observing process (the JCMT `Observation Desk'). Examples are:

sourceplot:
graphical representation of source positions.
scusky:
used to display the current configuration of SCUBA overlaid on an image of the region obtained from the Digital Sky Survey.
odfgen:
observations preparation tool for SCUBA
obslog:
allows observers to create observation logs and comment on the usefulness of the data

Of these, sourceplot is the most general and is not specifically designed for use at the JCMT (Fig. 1).

4. Modules Developed at the JAC

In many cases, development of these applications has required that extension modules be written to provide access to C/FORTRAN libraries from perl. It has been necessary to develop the following perl modules:

4.1 Messaging systems

Currently, both JCMT and UKIRT make use of the ADAM messaging system for telescope control and for data reduction systems. As part of the ORAC-DR system it was necessary to add the ability to send and receive ADAM messages from perl.

The JCMT is now in the process of upgrading its telescope system to DRAMA (the AAO's Distributed Real-Time Application programming system) (Farrell, Shortridge, & Bailey 1993). Given our previous experience with perl it has been decided to use perl for the high level interface to the telescope system. The first step in achieving this is complete and it is now possible to write DRAMA tasks in perl as well as sending and receiving DRAMA messages from perl user interfaces. This module also includes an interface to the SDS (self-defining data structure) format.

Figure 1: An azimuth-elevation image created from sourceplot. Zero elevation is at the edge of the image and 90 degrees elevation at the centre.
\begin{figure}
\plotone{jennesst2_1.eps}
\end{figure}

4.2 File I/O

Perl interfaces to access data files have been developed for the Starlink N-dimensional data format (NDF) and the Global Section Data (GSD) format in use at JCMT and UKIRT. Both these modules provide access to the complete set of library routines plus simplified wrappers using the PerlDL extension.

4.3 Astrometry

For astrometry calculations we have built an interface to Pat Wallace's SLALIB library.

4.4 Miscellaneous modules

Other perl modules developed at the JAC include:

5. Other Modules

Full use is made of perl modules written outside of the JAC. Most notable of these are:

5.1 CFITSIO

This module, written by Pete Ratzlaff, provides full access to the standard CFITSIO library allowing FITS files to be read into and written from perl programs.

5.2 PGPLOT

pgperl (Glazebrook 1996) is the perl interface to Tim Pearson's PGPLOT library. This package provides the full set of PGPLOT routines to the perl programmer. An example of using the perl PGPLOT interface and PDL can be found in the WORF system (Jenness, Economou, & Tilanus 1997) used at the JAC for remote eavesdropping of observing sessions.

5.3 PDL

From the perldl home page (pdl.perl.org, hosted by the JAC):

PDL (``Perl Data Language'') gives standard perl the ability to compactly store and speedily manipulate the large N-dimensional data arrays which are the bread and butter of scientific computing.

Of note for astronomy is that PDL includes a basic FITS reader as well as simple commands for reading NDF, GSD and other image formats. PDL also includes display interfaces to KARMA, SAOtng, PGPLOT and OpenGL.

References

Farrell, T. J., Shortridge K., & Bailey, J. A. 1993, BAAS, 25, 954

Glazebrook, K. 1996, in ASP Conf. Ser., Vol. 101, Astronomical Data Analysis Software and Systems V, ed. G. H. Jacoby & J. Barnes (San Francisco: ASP), 307

Jenness, T., & Economou, F. 1999, this volume, 171

Jenness, T., Economou, F., & Tilanus, R. P. J. 1997, in ASP Conf. Ser., Vol. 125, Astronomical Data Analysis Software and Systems VI, ed. G. Hunt & H. E. Payne (San Francisco: ASP), 401

Jenness, T., & Lightfoot, J. F. 1998, in ASP Conf. Ser., Vol. 145, Astronomical Data Analysis Software and Systems VII, ed. R. Albrecht, R. N. Hook, & H. A. Bushouse (San Francisco: ASP), 216



Footnotes

... Tilanus1
Netherlands Foundation for Research in Astronomy (NFRA)
... Best2
University of Victoria

© Copyright 1999 Astronomical Society of the Pacific, 390 Ashton Avenue, San Francisco, California 94112, USA
Next: WCSTools: An Image Astrometry Toolkit
Up: Software Systems and Tools
Previous: The STSDAS Table Selector Library
Table of Contents - Subject Index - Author Index - Search - PS reprint - PDF reprint

adass@ncsa.uiuc.edu