What can you do with an image with a world coordinate system attached to it? You can work on specific applications, such as tracking each pixel's sky position as a cursor moves across an image browser (Mink 1996). Or you can make WCS information easy to use and find out what happens. WCSTools provides both modular subroutines and simple programs which provide straightforward access to world coordinate information to programmers and astronomers as transparently as possible. Subroutines need only a FITS or IRAF image header and coordinates to transform. Programs need only a FITS or IRAF image and coordinates.
To make WCSTools subroutines easy to use, there are simple interfaces which require minimal information input-image headers and coordinates-and provide straightforward output: both formatted strings and binary numbers. Derived information is contained in a single data structure which can easily be passed between subroutines. In the most simple case, a subroutine user must read a FITS header, using their own subroutine or one included in this package, call wcsinit() to fill the WCS data structure, and call pix2wcs() or pix2wcst() for string output, to compute sky coordinates from image pixel coordinates or wcs2pix() to do the reverse.
As the WCSTools subroutines have been adopted as part of the SAOtng (Mandel 1997), its successor (as discussed by Joye & Mandel at this conference), and SkyCat (Albrecht et al. 1997) image browsers, many new features have been added at the request of the developers of those programs, and many bugs have been found by their users. Resolving these requests has taken a significant amount of the WCSTools developer's time, the aforementioned ``sell-out''. Spending that time, paid for by the developer's institution must be justified. Local use of the programs being developed elsewhere is one good reason to share code. More users find more bugs, the repair of which makes the programs more robust and thus more useful to everyone, including users at the developers institution.
The most difficult part of software development is to make it work with real data. WCSTools can read and write not only FITS image files, but IRAF .imh files, accessing most images made by astronomers. The image-reading subroutines can read the version 2 IRAF .imh files introduced in 1997 as well as version 1, and, unlike IRAF, can read images of either byte order on computers with either native byte order. The i2f program uses this capability to convert IRAF image files, no matter what their system of origin, to FITS files which can be more widely used.
To get WCS information out of as many kinds of images as possible, the WCSTools package supports 30 map projections, including the 8 AIPS projections (-SIN, -TAN, -ARC, -NCP, -GLS, -MER, -AIT, and -STG), 19 additional projections proposed as FITS WCS standards by Griesen & Calabretta (1996), the plate projection used by the Digitized Sky Survey, and IRAF and SAO polynomial projections. If no other WCS is present in the header, an approximate tangent plane projection WCS is created with the tangent point at the center of the image using the RA and DEC specified in the header, and a plate scale in arcseconds per pixel given in the image header or on the command line. As soon as a FITS standard WCS polynomial is proposed, it will be included as an option.
The use of WCSTools programs in scripts is illustrated by two recent projects undertaken at the Center for Astrophysics to improve galaxy positions. The first was an attempt to make sure that our database of spectra had positions good to an arcsecond or so. A Unix shell script was written which read lists totaling several thousand file names, extracted right ascensions and declinations from their headers using WCSTools gethead, extracted a Digitized Sky Survey field centered on that position into a local FITS file, and displayed that image using SAOimage, where the new -f1, -f2, and -f3 commands were used to set actions to be performed when the F1, F2, and F3 keys were used. These actions either sent the cursor position to the WCSTools sethead program which reset the position in the archive spectrum file or added the file name to a list of problem files or files which had really bad positions.
A second project was to get accurate positions of galaxies for the Updated Zwicky Catalog (Falco et al. 1999). Many of these positions could be obtained by matching the original Zwicky Catalog against catalogs with positions which were known to be good enough, but a list of ambiguous Zwicky Catalog entries remained. Region files containing labeled shapes at image coordinates computed from the sky positions of cataloged objects in Digitized Sky Survey images centered on the supposed position of a galaxy were written by the WCSTools imcat program and displayed by SAOimage. Using the function key commands described in the previous example, the coordinates of the correct position were added to a list. Figure 1 shows part of an SAOimage display of one of these images.
A future release of WCSTools will also include Internet access to catalogs and images. Code to read the tab tables format used by SkyCat catalog servers is already incorporated into WCSTools.
Albrecht, M. A., Brighton, A., Herlin, T., Biereichel, P., & Durand, D. 1997, in ASP Conf. Ser., Vol. 125, Astronomical Data Analysis Software and Systems VI, ed. G. Hunt & H. E. Payne (San Francisco: ASP), 333
Falco, E. E., et al. 1999, PASP, in press
Griesen, E. & Calabretta, M. 1996, A&A, submitted
Mandel, E. 1997, in ASP Conf. Ser., Vol. 125, Astronomical Data Analysis Software and Systems VI, ed. G. Hunt & H. E. Payne (San Francisco: ASP), 253
Mandel, E. & Murray, S. S. 1998, in ASP Conf. Ser., Vol. 145, Astronomical Data Analysis Software and Systems VII, ed. R. Albrecht, R. N. Hook, & H. A. Bushouse (San Francisco: ASP), 142
Mink, D. J. 1996, in ASP Conf. Ser., Vol. 101, Astronomical Data Analysis Software and Systems V, ed. G. H. Jacoby & J. Barnes (San Francisco: ASP), 249
, 1997, in ASP Conf. Ser., Vol. 125, Astronomical Data Analysis Software and Systems VI, ed. G. Hunt & H. E. Payne (San Francisco: ASP), 249
Monet, D. 1996, USNO-A1.0: A Catalog of Astrometric Standards, (Washington: USNO)