Path: iraf!irafmail-gateway
From: Vassilis.Charmandaris@obspm.fr (Vassilis Charmandaris)
Newsgroups: adass.iraf.sources
Subject: xiraf - A convenient way to start your IRAF session
Date: 9 Dec 1997 11:19:39 -0700
Organization: IRAF Project, National Optical Astronomy Observatories
Lines: 213
Sender: daemon@iraf.noao.edu
Message-ID: <199712091817.TAA05124@mesunb.obspm.fr>
NNTP-Posting-Host: tucana.tuc.noao.edu
Content-Transfer-Encoding: 7BIT


Hello there,

I would like to make available to everyone who is interested a couple of 
scripts I developed over the past few years. I think that they  simplify 
considerably the start-up of an IRAF session, as well as the initialization 
of the necessary files (i.e. login.cl) for any user.

They are available at:

	http://wwwusr.obspm.fr/~vassilis/xiraf

Assuming the one has in his/her workstation IRAF, X11IRAF, SAOimage and/or
SAORD (which includes the new SAOtng) the scripts create a login.cl for
the user if he/she does not have one already and start IRAF in the
following way:


 $ xiraf -h          :Show command options
 $ xiraf -help       :Show command options
 $ xiraf             :Start IRAF in an XGterm using the default image display
 $ xiraf -ximtool    :Start IRAF in an XGterm using XImtool for display
 $ xiraf -saoimage   :Start IRAF in an XGterm using SAOimage for display
 $ xiraf -saotng     :Start IRAF in an XGterm using SAOtng for display
 $ xiraf -rebuild    :Rebuild the login.cl file of the user. This should
                     :be used ONLY in the case of major IRAF version updates.

The "xiraf" script can be used by a single IRAF user in a stand alone IRAF
distribution. I can also be placed by the system manager to the standard 
PATH of the users in a set-up were the same IRAF binaries are available in 
a cluster of workstations.

These scripts do not interfere with the existing IRAF distribution. They 
have been tested on clusters of Sun/Solaris, Dec-Ultrix and Dec-Alphas,
with both Network Filesystems and Andrew Filesystems.

A more detailed description and sales-pitch of the scripts is appended at 
the end of this e-mail

Cheers,

Vassilis Charmandaris

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
 Vassilis Charmandaris          
 Observatoire de Paris, DEMIRM    e-mail: V.Charmandaris@obspm.fr
 61 Av. de l'Observatoire          phone: +33 1 40512346 
 F-75014 Paris                       fax: +33 1 40512002 
 France                              web: http://wwwusr.obspm.fr/~vassilis
///////////////////////////////////////////////////////////////////////////

----------------------------------------------------------------------------

                   Problems with the default IRAF start-up

Fist the good news: IRAF is a great package, probably the best in the
market, and above all one can get it for free in nice pre-compiled binaries
with easy to follow installation instructions.

Then the bad news: Once you have it in your system and if you want to serve
many users problems arise.

More specifically:

For the System Manager (SM)

   * The SM has to create and maintain the common fifo files (/dev/imt1o and
     /dev/imt1i) on each machine of the local cluster of workstations he/she
     wants to have IRAF running.
   * The SM has to create an IRAF login.cl file for every user since many do
     not quite understand what the command mkiraf does.

For the Novice User

To use IRAF (version 2.10 or later) to its full potential (nice graphics,
colors etc) the user had to do the following steps.

   * Open an xgterm instead of the usual Unix xterm after having read its
     proper Xresources.
   * Working on the xgterm the user has to go to the directory where his/her
     IRAF login.cl is located.
   * The user has to start the IRAF cl command on that directory.
   * Finally, the user has to choose the image display client (SAOimage,
     XImtool, or SAOtng) he/she prefers and start it with the proper
     options.
     This can be done using the task xray.xplot.ximtool. Another option is
     to start the image client externally from another window..

This procedure is time consuming and not very obvious to someone who starts
learning Unix, astronomy and IRAF at the same time. Frustration may also
appear when:

   * the user does not start IRAF in the directory of his/her login.cl file
     and as a result does not find all the installed packages.
   * the user encounter problems trying to run IRAF on a machine which
     access the IRAF binaries but for some reasons does not have the public
     fifo files installed.
   * the user has exited the IRAF environment ("cl>" prompt) but left an
     SAOimage session running which prevents him/her to view his/her images
     when he/she restarts IRAF and an new SAOimage
   * .. your own sad story ...

----------------------------------------------------------------------------

                  So why should one use the script xiraf ?!

Well, all of the problems presented above can be solved if the scripts xiraf
and start-iraf (which is being called internally by xiraf) are installed
together with the IRAF distribution.

When a user executes the script xiraf for the first time, xiraf creates a
set of personal fifo files, and then runs mkiraf, to create the login.cl
file of the user. Subsequently, the script opens an XGterm with the selected
image display client and starts IRAF inside this new XGterm. When a user
wishes to finish his/her session and issues the IRAF command cl>logout the
image display client, the IRAF session and the XGterm close keeping
everything nice and tidy...

If the user has already a login.cl file file then the script simply starts
IRAF in a new XGterm, as well as the selected image display program.

The script also allows the user to select in a transparent way the program
he/she wants to use to see his/her IRAF images. As far as I know there are
three in the market. First it's the old but reliable SAOimage. Then we have
XImtool the X-window resurrection of the old Sun Imtool which comes as as
part of the X11IRAF package. Finally, there is SAOtng ( SAO The Next
Generation) which, as Eric Mandel once told me, ... is much more than a
simple image display program... . The web sites from where one can down-load
the latest versions of all three programs are provided at the end of this
page.

The syntax of the new command is :

 $ xiraf -h          :Show command options
 $ xiraf -help       :Show command options
 $ xiraf             :Start IRAF in an XGterm using the default image display
 $ xiraf -ximtool    :Start IRAF in an XGterm using XImtool for display
 $ xiraf -saoimage   :Start IRAF in an XGterm using SAOimage for display
 $ xiraf -saotng     :Start IRAF in an XGterm using SAOtng for display
 $ xiraf -rebuild    :Rebuild the login.cl file of the user. This should
                     :be used ONLY in the case of major IRAF version updates.


These scripts do not interfere with the existing IRAF distribution. They are
just simplifying the intermediate steps. Users who don't like them do not
have to use them. They can run IRAF in the usual old way.

Technical Note: Other than having a set of options to automate things the
xiraf script forces the user to start his/her IRAF session with private fifo
files. This is done using the environment variable IMTDEV. In principle
private fifos are only necessary if one has multiple users running SAOimage
on the same workstation. XImtool and SAOtng do not have this problem.
However, my experience has shown that the public fifos (/dev/imt1o and
/dev/imt1i) are not by default present in all workstations systems. So using
personal fifo files makes the system manager of a cluster of workstations
accessing the same IRAF binaries happier...
----------------------------------------------------------------------------

Set-up Requirements

The scripts can be used either by a simple user who just wishes to simplify
his/her IRAF start-up process (by placing them somewhere in his/her
directory) or they can be installed in a global way for all IRAF users.

In the second case the System manager has to get the scripts xiraf and
start-iraf provided at the end of this page and place them in the standard
executable Unix PATH of the users. A series of site-dependent environment
variables have to be defined in the xiraf script,in trivial self-explanatory
way.

Minimum system requirements are: IRAF version 2.10 or later, as well as the
X11IRAF software package which includes the xgterm and ximtool executables.
The IRAF commands cl and mkiraf should be in the PATH of each potential IRAF
user. The location of all the other executables and programs called is
defined within the script.

Any potential IRAF user will simply have to type xiraf to start IRAF for the
first time. The script will prompt the user to define his personal IRAF
directory using an environment variable called USERIRAF and it will take
care of all the rest...

The scripts have been tested under IRAF versions 2.10.4 and 2.11, in a
cluster of DEC-Alphas and DEC-Ultrix as well as in a cluster of Sun machines
running Solaris version 2.5. It has been used in sites which use either NFS
(=Network File System) or AFS(=Andrew FileSystem) or mixed filesystems. The
image display packages used were:

        XImtool ver. 1.1, SAOimage ver. 1.20, and SAOtng ver. 1.7.1

The two scripts follow:

   * xiraf (13.8 Kbytes)
   * start-iraf (2.7 Kbytes)

Both scripts have plenty of comments so it's rather trivial to understand
their function. If you've managed to get IRAF running in your workstations
and you already have X11IRAF you'll be able to customize the script in your
system in 10min, or your money back ....

If you find these scripts useful send me an e-mail and let me know about it.
This way your institution will be proudly displayed in the list found at the
end of this web page. I would appreciate even more if you send me an e-mail
with comments or bugs you find.

I would like to acknowledge once more the help Mike Fitzpatrick who checked 
the scripts in their early form.

Vassilis Charmandaris
December 4th 1997
Paris, France

----------------------------------------------------------------------------


