Using the AST library to create and use
STC-S region descriptions
1David Berry,Peter Draper

1 -Joint Astronomy Centre, Hilo, Hawaii

New to AST? Start here,• AST is a library of functions that implement an object
oriented model for describing physical coordinate
systems, and the transformations that exist betweenthem.

• It provides a comprehensive range of facilities for
attaching world coordinate systems (WCS) to
astronomical data, for retrieving and manipulating that
information and for generating graphical output such as
coordinate grids based upon it.

What can AST do with an STC-S
description?

• STC is a data model, developed by Arnold Rots and theIVOA, for describing regions with a space, time and spectral
coverage.

• STC-S is a linear textual representation of the STC data
model geared towards human readers.

An example of a (rather complex!) compound spatial
STC-S description and its rendering by AST• It includes easy-to-use graphical facilities that allow theproduction of annotated 2D or 3D grids. Graphics are
draw via a simple “driver” module which AST calls todraw lines, strings, markers, etc. AST includes drivers for
PGPLOT; drivers for other graphics systems (e.g. Tcl/Tk,Java/Swing, etc.) can easily be (and have been) written.

• It forms the basis of the coordinate handling facilities inthe Starlink software collection, including GAIA, SPLAT,KAPPA, etc. It is also used in other non-Starlink software
such as DS9 and XIMAGE.

• Mask pixel arrays using an STC-S Region.
• Get the transformation between two STC-S coordinate• Extract specified axes from an STC-Region

Union ICRS GEOCENTER (Circle 180 10 2030°

Circle 190 10 20Intersection (STC-S and the Starlink Software
Collection:Difference (Circle 130 -10 20
Circle 125 -10 2)
Not (Circle 118 -8 3))

Declination

Circle 120 -10 200°

• CUPID is an application package within the Starlink-30°

Box 165 -30 30 60)

-60°
6h

810h
12h
Right Ascension

14Software collection that identifies and characterises
clumps of emission within a 2D or 3D data array. The
package has been modified to include an STC-S
description of the spatial shape of each clump within theoutput clump catalogue.

• The GAIA image and cube visualisation tool has been
modified to allow the 2D and 3D visualisation of thespatial STC-S descriptions created by CUPID.

The AST StcsChan class:• It is actively supported and developed by the Joint
Astronomy Centre, Hawaii.

• Test whether points are within an STC-S region.

systems.

celestial, spectral, time and other coordinate systems(including compound systems that combine axes ofdifferent types) and determining how to transformbetween them. This allows general purpose code to be
written that makes no assumptions about the nature of
the coordinate systems.
and modifying collections of coordinate framesinterconnected by arbitrarily complex transformations.

• Test whether two STC-S regions overlap.

• Convert STC-S Regions into other coordinate systems.

• It has built-in intelligence for identifying flavours of• It includes a flexible and versatile “tool-kit” for creating• Query and set values for individual STC-S properties.

• Plot the boundary of the STC-S Region

different forms, including FITS-WCS headers.
FORTRAN, Perl and Java (via JNI).

d.berry@jach.hawaii.edu

2 - Durham University, UK

The STC-S language:• It can read and write WCS information in several• It is written in pure ANSI C but also has interfaces for2

Dr David BerryLinks:• AST version 5.2 includes a new class called StcsChan.
This class provides methods for creating an AST Region
from a textual STC-S description, and for creating anSTC-S description from an AST Region. Once an ASTRegion has been created, all the facilities of AST can beused to manipulate and use the Region.

• The AST StcsChan and Region classes support the fullrange of STC-S axes (time, space, spectral and redshift).

• The StcsChan class supports most of STC-S version
1.33, including compound spatial regions. There are,however, a few exceptions and provisos, the main onesof which are

AST: www.starlink.ac.uk/ast
Starlink Software Collection: starlink.jach.hawaii.edu
STC-S: hea-www.harvard.edu/~arots/nvometa/v1.30/
STC-S-20090724.pdf
STC: www.ivoa.net/Documents/latest/STC.html
GAIA: www.starlink.ac.uk/gaia
CUPID: www.starlink.ac.uk/cupid
Joint Astronomy Centre, Hawaii: www.jach.hawaii.edu− There is no support for multiple intervals specifiedGAIA displaying polygons segmenting a SCUBA image
into clumps over a 2MASS J-band image.

within a TimeInterval, PositionInterval, SpectralInterval
or RedshiftInterval.
− The Convex identifier for the space sub-phrase is notsupported.
− There is no support for the following reference
positions: LOCAL_GROUP_CENTER,EMBARYCENTER, MOON, MERCURY, VENUS,MARS, JUPITER, SATURN, URANUS, NEPTUNE,PLUTO.
− Error values are supported but error ranges are not.
− Resolution, PixSize and Size values are ignored.
− Space velocity sub-phrases are ignored.
GAIA displaying STC-S polygon regions extruded
to define the extents of 3D clumps of emission
in a submillimetre cube.