World Coordinate Systems

The WCI library is concerned with the conversion between three types of coordinates associated with imaging data in astronomy, A dataset should contain the information required to generate axis offset from pixel number - in X-ray data this mapping is usually linear due to the necessarily heavily processed event stream, but with optical data this may not be the case. Generally there is then some map projection which defines the conversion from axis offsets relative to some fiducial point in the dataset into a position in some celestial coordinate frame. Details of the projection and the celestial frame are also contained in the dataset.

WCI provides routines to convert between all combinations of the three coordinates above, and an additional routine to convert between different celestial frames. The package supports most of the commonly used map projections in astronomy, and more besides.

WCI Data Objects

WCI uses three structured data objects to describe the relationships between the three coordinate systems above.

Pixellation

Describes the mapping between pixel number and axis offsets
Projection
Describes the map projection from axis offsets to a celestial frame
CoordSystem
Describes a celestial frame
These data structures are defined in the which can be listed in the ADI package wcs. WCI refers to the 3 coordinate types with the characters P, A and S respectively. The first two are represented in single precision floating point, and system coordinates in double precision (all WCI arithmetic is however performed in double precision). To convert from pixels and axis values requires only an object of class Pixellation. Conversion between axis values and system coordinates requires instances of both Pixellation and Projection (it might seem odd that a CoordSystem is not also required, but that object only describes a particular celestial system - the Projection object converts axis values into only one system).

Examples

Using the WCI data interface

Display the pointing information stored within a dataset whose name is supplied as the first argument to the program.
      PROGRAM POINTLOOK

      CHARACTER    FNAME*40,NAME*3,EFORM*1
      REAL         EPOCH, EQNX
      INTEGER      STATUS
      INTEGER      ID,PIXID,PRJID,SYSID

      CALL GETARG(1,FNAME)

      CALL ADI_FOPEN( FNAME, '*', 'READ', ID, STATUS )

      CALL WCI_GETIDS( ID, PIXID, PRJID, SYSID, STATUS )

      CALL ADI_CGET0C( SYSID, 'NAME', NAME, STATUS )
      CALL ADI_CGET0R( SYSID, 'EQUINOX', EQNX, STATUS )
      CALL ADI_CGET0R( SYSID, 'EPOCH', EPOCH, STATUS )
      CALL ADI_CGET0C( SYSID, 'EFORM', EFORM, STATUS )

      WRITE (*,'(2A)') 'File name         : ',FNAME
      WRITE (*,'(2A)') 'Coordinate system : ',NAME
      WRITE (*,'(A,F6.1)') 'Equinox           : ',EQNX
      WRITE (*,'(A,A1,F8.3)') 'Epoch             : ', EFORM, EPOCH

      END
This program produces output looking like,

      % pointlook myimage.fits

      File name         : myimage.fits
      Coordinate system : FK5
      Equinox           : 2000
      Epoch             : J1995.3

Using WCI without datasets

Write a program to convert FK4, equinox 1950, epoch 1962.7 to FK5, equinox 2000, epoch 1995.3.
      PROGRAM CCONV

      DOUBLE PRECISION DTOR
        PARAMETER ( DTOR = 3.14159265358979D0/180D0 )

      DOUBLE PRECISION IN(2), OUT(2)
      INTEGER      FK4, FK5, STATUS

      STATUS = 0
      CALL WCI_NEWSYS( 'FK4', 1950.0, 1962.7D0, FK4, STATUS )
      CALL WCI_NEWSYS( 'FK5', 2000.0, 1995.3D0, FK5, STATUS )

      READ(*,*)    IN
      IN(1) = IN(1) * DTOR
      IN(2) = IN(2) * DTOR
      CALL WCI_CNS2S( FK4, IN, FK5, OUT, STATUS )
      PRINT *,OUT(1)/DTOR,OUT(2)/DTOR

      END
This short program illustrates the use of WCI to convert from one coordinate system to another. Two identifiers are constructed to describe the 2 celestial frames, and the WCI_CNS2S is used to convert the coordinates read from the user.

Further Reading

For an easily readable and coherent description of angular coordinate systems, dates and calendars see SUN/67, the description of the Starlink Positional Astronomy Library (SLA).

The names and mathematical definitions of the projections supported by WCI were taken from Representation of Coordinates in FITS.

David J. Allan (dja@star.sr.bham.ac.uk)