Browsing Images in World Coordinate Space with SAOimage, D.J.Mink(1995), presented at the Fifth Annual Conference on Astronomical Data Analysis Software and Systems, published in Astronomical Data Analysis Software and Systems V, A.S.P. Conference Series, Vol. 101, 1996, George H. Jacoby and Jeannette Barnes, eds., p. 96.

Browsing Images in World Coordinate Space
with SAOimage

Abstract

Introduction

The availability over the Internet of many large-scale astronomical surveys, such as the IRAS Infrared Sky Survey (Van Buren et al 1995), and the HST Digitized Sky Survey (Morrison 1995), as well as the Hubble Space Telescope archives (Travisano 1995) was discussed at the 1994 Conference on Astronomical Data Analysis Software and Systems. In addition to such World Wide Web interfaces to specific data sets, SkyView (McGlynn et al 1995) provides a versatile interface to data from many surveys.

Information linking spatial coordinates (world coordinate system or WCS) to image pixel coordinates is inserted into the headers of the FITS images derived from these surveys. Descriptions of standard projective systems are now being standardized (Greisen and Calabretta 1995a, 1995b). The Digitized Sky Survey, scanned from photographic plates rather than created from digital detectors, provides plate solutions with each extracted image. All that was needed was an easy-to-use viewing program which could display WCS information.


Teaching Old Software New Tricks

SAOimage was developed in the late 1980's at the Smithsonian Astrophysical Observatory to display astronomical images (Van Hilst 1990). Its ease of use, simplicity, and portability have made it popular throughout the astronomical community.

When the wealth of available WCS-containing FITS-format information became apparent, steps were taken to add world coordinate access to SAOimage. Both cursor tracking in sky coordinates (see figure 1) and the ability to export cursor positions as sky coordinates were added to the program. Additional capablities have been added as users requested them and new data formats became available.

 
Figure 1: SAOimage displays world coordinates at the cursor position, in this case FK4/B1950 right ascension and declination, above the image pixel coordinates
\begin{figure}
\plotfiddle{minkd1.eps}{2.00in}{270.0}{50.0}{50.0}{-195.0}{220.0}\end{figure}

SAOimage was first modified in version 1.09 to extract WCS parameters from FITS image headers. A WCS data structure was developed, and the worldpos C subroutines by Bill Cotton and Don Wells, which implement the eight projections from classic AIPS (see Table 1), were modified to work with it. Subroutines to initialize the data structure and to convert WCS cursor positions into character strings completed a self-contained library. Digitized Sky Survey plate solution algorithms were added in version 1.12. As an example of its portability, this library is also being used in a new image display program, SAOtng (Mandel 1995).

 
Table 1: World coordinate systems supported by SAOimage
CTYPE value Projection Comment
-AIT Hammer-Aitoff equal-area all-sky
-ARC Zenithal equidistant closest to a Schmidt plate
-CAR Cartesian linear, default
-GLS Samson-Flamsteed global sinusoidal projection
-MER Mercator  
-NCP North Celestial Pole polar
-SIN sinusoidal orthographic
-STG Stereographic zenithal orthomorphic projection
-TAN tangent plane gnomonic

The option of displaying or exporting coordinates in systems other than that used in which the image header was added in version 1.14. Subroutines derived from Patrick Wallace's SLALIB positional astronomy library (Wallace 1994) were used to translate between FK4, FK5, and galactic coordinate systems. Version 1.17 extended WCS access to IRAF OIF images, by internally translating IRAF headers to FITS headers and extracting parameters using the code already used for FITS files.


Cursor Position Display

The "c" command was added in SAOimage version 1.09 to print the current cursor position in world and image pixel coordinates, along with the value of the closest pixel. Right ascension and declination are printed as
hh:mm:ss.sss dd:mm:ss.ss;
galactic latitude and longitude are printed as
dd.ddddd dd.ddddd.
If WCS information is not available in the header, only pixel coordinates and value are returned.

In version 1.14, commands were added to SAOimage to print the world coordinates of the current cursor position in any of three coordinate systems. Coordinates will be converted if this is not the same system as that in the image header. b prints the current cursor coordinates in the B1950 (FK4) system as hh:mm:ss.sss dd:mm:ss.ss B1950 . j prints the cursor coordinates in the J2000 (FK5) system as hh:mm:ss.sss dd:mm:ss.ss J2000 . g prints the cursor position in galactic coordinates as dd.ddddd dd.ddddd galactic . If SAOimage is being used to look at a local image, output will be to the window from which SAOimage was invoked. If SAOimage is being used with Mosaic, output is sent to the console window. Netscape sends output from helper applications to a new window, but not until several lines have been sent.

Additional command line flags set the format in which the world coordinates of the current cursor position will be displayed. The same position string that is displayed above the pixel coordinate in the SAOimage window is sent to standard output when the "c" command is used and to an external program when the "w" cursor command is issued.

Adding the switch -fk4 or -b1950 to the command line causes the cursor to track in FK4/B1950 right ascension and declination. The coordinates in hours, minutes, and seconds of right ascension and degrees, minutes, and seconds of declination will put into a string of the format hh:mm:ss.sss dd:mm:ss.ss B1950 .

The switch -fk5 or -j2000 makes the cursor track in FK5/J2000 right ascension and declination, displaying hh:mm:ss.sss dd:mm:ss.ss J2000 .

The command line switch -galactic (which may be shortened to -gal) causes the cursor to track in galactic longitude and latitude. The coordinates in decimal degrees will be displayed to five decimal places in the format dd.ddddd dd.ddddd galactic . Leading zeroes are dropped.


Sending the Cursor Position to Another Program

To set the external command to be executed, add -wcscom followed by a space-free string containing a Unix command string to the command line. The world coordinate string will be substituted for %s in the Unix command string, as in C formatted output. Underscores should be used instead of spaces. The "w" cursor command executes the command specified on the command line using -wcscom, passing the string corresponding to the current cursor position.

To search the Hubble Space Telescope Guide Star Catalog in a 30-arcsecond-square region centered on the current cursor position using the RGSC program, add -wcscom rgsc_%s_-box_0:00:15 to the saoimage command. When the cursor is centered on the star in the upper right corner of figure 1, the "w" command prints the following:

HST Guide Stars B1950

HSTGSC at  13:27:32.976   47:29:10.88 30" x 30" (B1950)

3460.0534  13:27:32.285   47:29:04.27 14.98 0 1     9.87 

Web Browsing with SAOimage

SAOimage can be used as a "helper" application to a World Wide Web browser such as Netscape or Mosaic. To make sure SAOimage is used whenever a FITS image is encountered, this line should be added to your .mime.types file:
	image/x-fits                   fit fits fts FIT FITS 
and this line to your .mailcap file
	image/x-fits;                saoimage -fits %s 
To serve FITS files from a http server so that SAOimage will be invoked to browse them, add this line to the httpd srm.conf file:
	AddType image/x-fits    .fit    .fits   .fts    .FIT    .FITS 
and make sure that any FITS files on your server have one of those extensions.


References

Greisen, E. and Calabretta, M. 1995a, in Astronomical Data Analysis Software and Systems IV, ASP Conf. Ser., Vol. 77, eds. R.A. Shaw, H.E. Payne, and J.J.E. Hayes, 233. [full text]

Greisen, E. and Calabretta, M. 1995b, submitted to Astronomy and Astrophysics. [about this paper]

Mandel, E. and Tody, D. 1995, in Astronomical Data Analysis Software and Systems IV, ASP Conf. Ser., Vol. 77, eds. R.A. Shaw, H.E. Payne, and J.J.E. Hayes, 125. [full text]

McGlynn, T., White, N., and Scollick, K. 1994, in Astronomical Data Analysis Software and Systems III, ASP Conference Series, Vol. 61, eds. D.R. Crabtree, R.J. Hanisch, and J. Barnes [full text]

Morrison, J. 1995, in Astronomical Data Analysis Software and Systems IV, ASP Conf. Ser., Vol. 77, eds. R.A. Shaw, H.E. Payne, and J.J.E. Hayes, 179. [full text

Travisano, J. 1995, in Astronomical Data Analysis Software and Systems IV, ASP Conf. Ser., Vol. 77, eds. R.A. Shaw, H.E. Payne, and J.J.E. Hayes, 80. [full text]

Van Buren, D., Ebert, R., and Egret, D. 1995, in Astronomical Data Analysis Software and Systems IV, ASP Conf. Ser., Vol. 77, eds. R.A. Shaw, H.E. Payne, and J.J.E. Hayes, 84. [full text]

VanHilst, M. 1990, Bulletin of the American Astronomical Society, Vol. 22, 935.

Wallace, P. 1994, in Astronomical Data Analysis Software and Systems III ASP Conference Series, Vol. 61, eds. D.R. Crabtree, R.J. Hanisch, and J. Barnes. [full text]


[SAOimage] [WCSTools]