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.
Pixellation
Describes the mapping between pixel number and axis offsetsProjection
Describes the map projection from axis offsets to a celestial frameCoordSystem
Describes a celestial frameThese 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).
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
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.
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)