Chapter 4
Applications Packages

 4.1 ASTERIX — X-ray data analysis
 4.2 CCDPACK — CCD data reduction
 4.3 CONVERT — Data format conversion
 4.4 DAOPHOT — Stellar photometry
 4.5 FIGARO — General spectral reduction
 4.6 IRCAM — Infrared camera data reduction
 4.7 KAPPA — Kernel applications
 4.8 PHOTOM — Aperture photometry
 4.9 PISA — Object finding and analysis
 4.10 SCAR — Star catalogue database system
 4.11 SPECDRE — Spectroscopy data reduction
 4.12 SST — Simple software tools
 4.13 TSP — Time-series and polarimetry analysis

When you run ICL and type:


you will be shown two lists of packages. The first contains Standard packages which are available at all Starlink sites. The other contains Options which are made available at a site only on request.

This Chapter gives a brief overview of each package, while Chapter 20 describes the specific commands available within each package. Further information can be obtained from their associated Starlink User Note (SUN) which is referenced at the top of each section. Starlink software as a whole is described in SUN/1.

An important part of the rationalization of Starlink software which the coming of ADAM made possible concerns data structures. The Hierarchical Data System (HDS) (see Chapter 10) is very flexible, and is capable of creating an infinite variety of data structures. Without recommending some standard structure there would be a danger of programmers writing applications which could not read each other’s data. If the standard is also implemented in a small number of routines, the restrictions imposed by the standard also make programming easier. The main unifying theme of Starlink applications is the standard data format defined by Starlink; this is the Extensible N-dimensional Data Format — NDF — described in Section 10.2. This is centred on an n-dimensional data array that can store most astronomical data such as spectra, images and spectral-line data cubes. The NDF may also contain such information as title, axis labels and units, and error and quality arrays. There is also a place to store ancillary data associated with the data array. These could be information about the original observing set-up, such as airmass during the observation or temperature of the detector; there may be calibration data or results produced during processing, for example spectral line fits. Groups of related parameters not defined by the NDF format itself are held in extensions.

A key component of Starlink software is KAPPA (Kernel Application Package). This does not process non-standard extensions, but neither does it lose them — it copies them to any NDFs which it creates. Other application packages may be able to process some, but not all, extensions. It is hoped that such packages will use KAPPA applications as templates, in procedures, or directly as appropriate.

Each section below contains a sketch of how to use the application being described. In these:

    $ command

means “issue the command from DCL”, while:

    ICL> command

means issue it from ICL. Remember that before using any of these packages, the commands:

    $ @SSC:LOGIN  

should have been executed. Likewise, to run ICL you should type:

    $ ICL

to get the ICL prompt.

The packages described in this chapter are listed below ordered by function. This should help you find a package which is appropriate for a particular purpose. The packages are then described in alphabetical order on separate pages.

Image Analysis & Photometry
— Kernel applications
— Stellar photometry
— Aperture photometry
— Object finding and analysis
— General spectral reduction
— Spectroscopy data reduction
Specific Wavelengths
— X-ray data analysis
Specific Instruments
— CCD data reduction
— Infrared camera data reduction
— Time series and polarimetry analysis
Database Management
— Catalogue data base system
— Data format conversion
— Simple software tools

4.1 ASTERIX — X-ray data analysis


This is a collection of programs to analyse astronomical data in the X-ray waveband. Many of the programs are general purpose and are capable of analysing any data in the correct format. It is instrument independent and currently has interfaces to the Exosat and Rosat instruments.

ASTERIX data are stored in HDS files and are therefore compatible with all ADAM packages. There are basically two different types: binned and event datasets. Binned data (e.g. time series, spectra, images) are stored in files whose structure is based on the Starlink standard NDF format (SGP/38). Data errors (stored in the form of variances) and quality are catered for. Event data sets store information about a set of photon ‘events’. Each event will have a set of properties, e.g. X position, Y position, time, raw pulse height.

The input data are first processed by an instrument interface. Event data are then processed and binned, and then the binned data are processed. Finally, graphical output is generated.

The commands may be classified as follows:


from ICL:

   $ ICL  
   ICL> (any ASTERIX command)

from DCL:

   $ ASTHELP  
   $ (most, but not all, ASTERIX commands)


A demonstration session is described in SUN/98.

4.2 CCDPACK — CCD data reduction


A package to perform the initial processing of CCD data. Its main advantage over previous methods is its enhanced functionality. It processes large amounts of data easily and efficiently, with a minimum of effort on the user’s part.

It includes routines for performing:

The following features are of particular note:


from ICL:

   ICL> <individual commands>  
   ICL> HELP <command>

from DCL:

   $ CCDPACK  
   $ CCDHELP  
   $ (any CCDPACK commands)

4.3 CONVERT — Data format conversion


This package converts data between the Starlink standard n-dimensional data format (NDF) and other formats. Currently, it can handle three data formats:


from ICL:

   ICL> (any of the CONVERT programs)

from DCL:

   Simply type the name of the conversion program you want.


This will convert an NDF file into BDF format, as used by the earlier Interim environment.

   NDF - Name of NDF to be converted > adam_examples:image  
   BDF - BDF filename > image  

A file IMAGE.BDF will have been created in your current directory.

4.4 DAOPHOT — Stellar photometry


A stellar photometry package written by Peter Stetson at the Dominion Astrophysical Observatory, Victoria, B.C., Canada and adapted for use under ADAM. It performs the following tasks:

Profile fitting in crowded regions is performed iteratively, which improves the accuracy of the photometry. It does not directly use an image display (which aids portability), although three additional routines allow results to be displayed on an image device. It uses image data in NDF format.


from ICL:

   Cannot be run from ICL.

from DCL:

   $ DAOPHOT  
   Command: HELP  
   Command: ...  
   Command: EXIT

N.B. If you enter ‘DAOPHOT’ just to see what happens, you will be disappointed to receive the message ‘Value unacceptable –- please re-enter’. You will need to read the documentation and user manual before you can make any progress with this program.

4.5 FIGARO — General spectral reduction


This is a general data reduction system written by Keith Shortridge at Caltech and the AAO. Most people find it of greatest use in the reduction of spectroscopic data, though it also has powerful image and data cube manipulation facilities. Starlink recommends FIGARO as the most complete spectroscopic data reduction system in the Collection. Examples of its facilities are:

At present, a number of related packages are bundled with FIGARO. In future, these may be released as separate items. They include:


This reduces and analyses long-slit and optical-fibre array spectra. A number of its functions are useful outside the area of spectroscopy. The main application areas are:

  • Line profile analysis; LONGSLIT analyses calibrated long-slit spectra. For example, it can fit Gaussians, either manually or automatically, in batch. It can handle data with two spatial dimensions, such as TAURUS data. FIBDISP provides further options useful for such data, although it is primarily designed for fibre array data. An extensive range of options is available, especially for output.
  • Two-dimensional arc calibration.
  • Geometrical distortion correction; S-distortion and Line curvature.
  • Conversion between FIGARO and IRAF data formats.
  • Display programs.
  • Removing continua.

To run FIGARO:

from ICL:

   ICL> (any FIGARO commands)

from DCL:

   $ FIGARO  
   $ (any FIGARO commands)

4.6 IRCAM — Infrared camera data reduction


This package reduces, displays, and analyses 2-dimensional images from the UKIRT infrared camera (IRCAM). The image data reduction facilities available are:

The graphics and image display facilities available are:

To run IRCAM:

from ICL:

   Cannot be run from ICL (it uses the older ADAMCL).

from DCL:

     (you are then asked to say where your data are  
      and which plotting device you want to use)  
   Ircam-CLRED : > ?  
     (produces a list of commands)  
   Ircam-CLRED : > (select commands)  
   Ircam-CLRED : > EXIT

4.7 KAPPA — Kernel applications


The Kernel Application Package runs under ADAM, using the NDF data format, and provides general-purpose applications. It is the backbone of the software reorganization around the ADAM environment, and its applications integrate with other packages such as PHOTOM, PISA, and FIGARO. It is usable as a single large program from the ADAM command language ICL, or as individual applications from DCL.

It handles bad pixels, and processes quality and variance information within NDF data files. Although oriented towards image processing, many applications will work on NDFs of arbitrary dimension. Its graphics are device independent. Currently, KAPPA has about 140 commands and provides the following facilities for data processing:

There are also many applications for data visualization:

To run KAPPA:

See Chapter 3 for a demonstration of KAPPA.

4.8 PHOTOM — Aperture photometry


This performs aperture photometry. It has two basic modes of operation:

The aperture is circular or elliptical, and the size and shape can be varied interactively on the display, or by entering values from the keyboard or parameter system. The background sky level can be sampled interactively by manually positioning the aperture, or automatically from an annulus surrounding the object.

To run PHOTOM:

from ICL:

    IN - NDF containing input image /@ramp1/ > adam_examples:image  
    COMMAND - PHOTOM /’Values’/ > H (for help)  
    COMMAND - PHOTOM /’Values’/ > (an option from the menu)  
    COMMAND - PHOTOM /’Values’/ > E

from DCL:

    IN - NDF containing input image /@ramp1/ > adam_examples:image  
    . (as above)

4.9 PISA — Object finding and analysis


The Position, Intensity and Shape Analysis package, PISA, locates and parameterizes objects in an image frame. The core of the package is a routine which performs image analysis on a 2-dimensional data frame. It searches for objects having a minimum number of connected pixels above a given threshold, and extracts the image parameters (position, intensity, shape) for each object. The parameters can be determined using thresholding techniques, or an analytical stellar profile can be used to fit the objects. In crowded regions, deblending of overlapping sources can be performed.

The package derives from the APM IMAGES routine originally written by Mike Irwin at the University of Cambridge to analyse output from the Automatic Photographic Measuring system.

To run PISA:

from ICL:

    ICL> PISA  
    ICL> <individual commands>  
    ICL> HELP <command>

from DCL:

    $ PISA  
    $ <individual commands>  
    $ HELP <command>


This example performs isophotal analysis with deblending of overlapped images on a frame containing a mixture of stars and galaxies. The results are then plotted on a suitable device.

   ICL> PISA  
        Welcome to PISA ...  
   IN - NDF containing input image /.../ > PISA_DIR:FRAME  
    Analysing whole image  
   MINPIX - Minimum pixel size for images (typically 4-16) > 6  
   METHOD - Intensity analysis ( 0=Isophotal, 1=Total, 2=Profile ) /0/ > 0  
    Estimated background level =   492.2  
    Background standard deviation =     7.4  
   BACKGROUND - Background (global sky) value /492.17/ >  
   THRESH - Threshold for analysis (data units) /18.61135/ >  
    Total number of positive images = 118  
    The results have been written to PISAFIND.DAT  
        and PISASIZE.DAT  
   RESULTS - File of PISAFIND parameterised data /@PISAFIND.DAT/ >  
   DEVICE - Name of graphics device /@IKON/ >  

4.10 SCAR — Star catalogue database system

[SUN/70, 106]

The Starlink Catalogue Access and Reporting system is a relational database management system. It was designed principally for extracting information from astronomical catalogues, but it can be used to process any data stored in relational form. A large number of catalogues are available, including the IRAS catalogues. For general database requirements, REXEC may be preferable. SCAR can perform the following functions:

A distinctive feature of SCAR is the use of index files which you can create and which contain pointers to rows in one or more catalogues. This is a compact and flexible method of accessing catalogues; for example, a very large catalogue may be physically ordered by declination, but you can create an index giving access to it ordered by flux.

To run SCAR:

from ICL:

   ICL> SCAR  
   ICL> SCAR_HELP  (for help on SCAR)  
   ICL> CAR_HELP   (for help on CAR commands)  
   ICL> CAT_HELP   (for help on catalogues)  
   ICL> (any SCAR commands)

from DCL:

   $ (any SCAR commands)


A script is available which demonstrates some of the features of SCAR. It can be invoked by typing:


It is suggested that you run this in an empty directory so that you can identify the files which have been created.

4.11 SPECDRE — Spectroscopy data reduction


A package for spectroscopy data reduction and analysis. It fills the gap between FIGARO and KAPPA — on the one hand, all its routines conform with Starlink’s concept of bad values and variances, on the other hand, they offer spectroscopy applications hitherto available only in FIGARO. In general, it can work on data sets with seven or less axes. Often an application will take just a one-dimensional subset as a spectrum. In most cases the spectroscopy axis can be any axis, but for some applications must be the first axis.


from ICL:

   ICL> <individual commands>  
   ICL> HELP <command>

from DCL:

   <not specified>

4.12 SST — Simple software tools


The Simple Software Tools package helps produce software and documentation, with particular emphasis on ADAM programming using Fortran 77. It performs fairly simple manipulations of software, and also tackles some of the commonly encountered problems which are not catered for in the more sophisticated commercial software tools (such as FORCHECK and VAXset) available on Starlink.

The main purpose of the first version is to extract information from subroutine ‘prologues’, and to format it to produce various forms of user documentation. A simple source-code and comment statistics tool is also included.

There are five applications:

To run SST:

from ICL:

   ICL> SST  
   ICL> HELP <any SST command>  
   ICL> (any of the SST commands)

from DCL:

   $ SST  
   $ (any of the SST commands)


This simple demonstration will create a file containing statistics about source and comment lines in a Fortran program; the one used happens to be the one which is run in the demonstration.

   ICL> SST  
   IN - Input file(s) /’*.FOR’/ > CONVERT_DIR:CONVERT.FOR  
   . (messages from FORSTATS)  
   . (the output which was written by FORSTATS)  

4.13 TSP — Time-series and polarimetry analysis


This is a data reduction package for time-series and polarimetric data. These facilities are missing from most existing data reduction packages which are usually oriented towards either spectroscopy or image processing or both. Currently TSP can process the following data:

To run TSP:

from ICL:

   ICL> TSP  
   ICL> (any TSP command)

from DCL:

   Cannot be run from DCL.


The following example shows the use of the PPLOT command to plot a polarization spectrum. The SN1987A data file is included with the software, so you can use this command to check that TSP is working.

    ICL> PPLOT  
    Loading TSP_DIR:TSP into xxxxTSP  
    INPUT - Stokes Data to Plot > TSP_DIR:SN1987A  
    BINERR - Error per bin (per cent) /0.1/ >  
    AUTO - Autoscale Plot /YES/ >  
    LABEL - Label for plot /’’/ > SN1987A  1987 Sep 2  
    DEVICE - Plot Device > IKON