AST - A Library for Handling World Coordinate Systems in Astronomy




  1. AST - What is it?

  2. AST Support for IVOA STC-S

  3. AST Support for STSci ASDF Format

  4. FITS-WCS Plotting Demo

  5. Documentation

  6. Obtaining AST

  7. Using AST from Python

  8. Using AST from Perl

  9. Using AST from Java

  10. Using AST from the UNIX shell

  11. Support for AST

AST - What is it?

The AST library provides a comprehensive range of facilities for attaching world coordinate systems to astronomical data, for retrieving and interpreting that information and for generating graphical output based on it. It's main selling points are:

AST is different to other popular FITS-based WCS packages in that it takes a very high level, generalised "object oriented" view of the problems of describing, using and storing WCS information. For this reason, it is very easy to use - it wraps up all the complications of dealing with the specifics of different classes of coordinate systems (celestial, spectral, pixel, etc). Another reason it is easy to use is that it hides completely the sometimes elaborate details of FITS WCS handling, and uses a completely FITS-independent and much cleaner interface more closely associated with the general nature of world coordinate information. However, it is possible to go both ways between AST and FITS (albeit the AST representations are much richer than the FITS and so some information may be lost in going from AST to FITS).

All coordinate systems are described by "Frame" objects which encapsulate information about the nature of the coordinate system - axis labels, units, how to convert axis values to and from text strings, how to "measure distance" within the Frame (the Frame metric), etc, etc. There are then subclasses of Frame which "know" about more specific coordinate systems - at the moment the three main subclasses are SkyFrame (which describes celestial positions on the sky), SpecFrame (which describes positions within a spectrum) and TimeFrame (which describes moments in time). All these classes can describe positions within their respective domains using all the common coordinate systems (various equatorial, ecliptic, galactic, etc for sky positions, wavelength frequency, various velocities, etc, for spectral, different timescales, etc, for time). They also know how to transform axis values between these systems. There is also a "compound Frame" class which allows any two Frames (of any class) to be joined together (for instance, you could compound a SkyFrame and a SpecFrame to describe a spectral cube). These various forms of Frame can be connected together using "Mappings". A Mapping is a mathematical recipe for transforming a position within one coordinate system into another. There are subclasses of Mapping which implement a wide range of different transformation. These include:

A "FrameSet" is a collection of Frames connected together by Mappings. A FrameSet can be created from a FITS header (for instance) using a single call. The FrameSet can then be used to transform positions between nominated coordinate systems, to convert axis values to and from text strings using formats automatically chosen to be appropriate to the class of Frame, to plot coordinate grids (using any graphics system you like), etc. FrameSets can be searched for Frames with particular characteristics.

FITS-WCS Plotting Demo

A WWW-based demo is available which allows you to enter a set of FITS-WCS headers and then produces an annotated coordinate grid using the facilities of the AST Plot class. Useful for exploring FITS-WCS as well as AST plotting options.

AST Support for STSci ASDF Format

AST contains a class called YamlChan that will convert between WCS stored in STSci's ASDF YAML-based format and AST. Note, currently the YamlChan class only supports celestial coordinate systems (i.e no spectral or time systems are supported).

Here are some examples programs that make use of the YamlChan class:

AST Support for IVOA STC-S

AST contains a class called StcsChan that will convert between IVOA STC-S descriptions and AST Regions. A poster paper was presented on this at ADASS 2009.

A WWW-based demo is available which allows you to test STC-S regions for overlap, test points for inclusion in an STC-S region, and draw the boundary around an STC-S region.

Here are some examples programs that make use of the StcsChan class:


The AST library has been presented at various conferences ove past years. For instance, see

Obtaining AST

AST is available pre-built as part of the Starlink Software Collection, which is now maintained by the East Asian Observatory, Hawaii.

The source for the current development version of AST can be viewed on github.

The source code tar file for AST V9.2.9 is available here (18 MB) (release notes). To build it, do:

 % tar -xzf ast-9.2.9.tar.gz
 % cd ast-9.2.9
 % ./configure --prefix=???
 % make 
 % make install

Replace the "???" string with the path to the directory in which you want AST to be installed

Using AST from Python

The Python interface was written by David Berry and Tim Jenness, and can be installed by doing "pip install starlink-pyast". You can also clone the github repository of you prefer.

Using AST from Perl

The Perl interface for AST was written by Tim Jenness and Brad Cavanagh of the Joint Astronomy Centre, Hilo, Hawaii, and Alasdair Allan of Starlink.

Using AST from Java

The Java JNI interface for AST was written by Mark Taylor and is contained in a package called JNIAST. The javadocs documentation for JNIAST is available here. JNIAST is available here, or can be obtained from the jniast directory within the StarJava Git repository.

Using AST from the UNIX shell

The Starlink Software Collection includes a package called ATOOLS that uses a command line interface similar to KAPPA, CCDPACK, etc. It contains one-to-one equivalents to the majority of the functions available in the AST library, allowing quick experiments to be performed from the shell, and providing access to the full power of AST from within shell scripts. Descriptions of AST objects may be stored in text files or in NDFs. There is currently no Starlink User Note describing ATOOLS, but the online help system (accessed using the ATOOLS command "atlhelp") describes how to use the commands.

Support for AST

The Starlink project became unfunded at the end of June 2005. However, the AST library continues to be supported by East Asian Observatory. Please contact David Berry (

Starlink: AST (last edited 2022-06-06 11:18:08 by DavidBerry)