running multiple IRAF sessions and display tools

The Problem

Running one IRAF session and one display tool per user is no problem. If you want to start up a second IRAF session as the same user it is also unproblematic. However, this second IRAF session will also use the first display tool to display images. Now if you start a second display tool for the second IRAF session you suddenly notice that it will also display images from your first IRAF session. So how can you use two IRAF sessions on the same computer, each using it's own display tool ?

The Solution

You can start your first IRAF session as usual or according to the rules below. Every additional session/display tool combination has to be started according to the following recipe (the commands all have to be typed in the same window):
  1. set the environment variable IMTDEV to a unique name. eg:

    setenv IMTDEV unix:$HOME/.IMTb%d

  2. start your display tool telling it to use this unique name as the unix domain socket to receive input from.
    For ds9:
    ds9 -unix_only -unix $IMTDEV:s/unix:// &

    For ximtool:
    ximtool -unix_only -unix $IMTDEV:s/unix:// &

    Note: This example assumes you are running tcsh as your shell. Instead of $IMTDEV:s/unix:// you could of course have typed in the file name ($HOME/.IMTb%d in this case) directly.

  3. Now start your second IRAF session.
For a third IRAF/display tool combination you would just have to change the name of the unix domain socket (for example, use a "c" instead of the "b"). And so on ...

Background Information

IRAF and the display tools can communicate in three ways:
  1. unix domain socket
  2. FIFO
  3. TCP/IP socket
IRAF will try to communicate with the display tool through a unix domain socket first. This socket is usually created in /tmp by the display tool when it is started. FIFO's can be used as well to communicate with distinct display tools from different IRAF sessions but they require also changes to the IRAF graphcap file which makes them more awkward to handle.

Related Information

Hints for Setting Up and Using XGTERM and XIMTOOL in IRAF Newsletter #13
06. Sep. 2000 Robert Greimel