IRAF and the CL


IRAF has the ability to transfer files,
display images, and access devices such as tape drives, on one computer host from another in a local area network. IRAF networking can be used with almost any IRAF or STSDAS task because the networking capability is part of the Virtual Operating System (VOS), upon which all IRAF tasks are layered. However, file access between hosts with incompatible architectures (like between a Unix machine and VAXes running VMS) will not generally be possible unless the files are stored in a machine-independent format. (The exceptions are the tasks in the stsdas.toolbox.convfile package, which are specifically designed for transferring images and binary tables across machine architectures.) Note that OIF (.imh) and GEIS (.hhh) images and binary tables are stored in the native machine format, so accessing such images or tables will not work unless the local and remote hosts are of the same architecture, i.e., either both Unix or both VMS. FITS (.fit), pixel list (.pl), and ASCII files are machine independent, so numerical compatibility is not an issue in these cases.

To use IRAF networking, you must have a login account on each machine to which you intend to connect, and IRAF V2.10.2 or later (or at least the IRAF Kernel Server) must be installed on these machines. Your IRAF site manager must also create a set of files in the "dev$" directory which contain, among other things, the names of all the nodes on the network; these files must reside on all the servers in the network. To see if your machine is in this list, run the netstatus task. If your host is not listed, it must be added before you can use IRAF networking.

The Irafhosts File

To use the networking facility, you must have a file named ".irafhosts" in your login directory on each system or cluster (group of workstations sharing a common file system) to which you will connect. This file tells the IRAF networking system how to connect to the IRAF kernel server on a remote node. This file can be copied from the IRAF system directory (dev$). For example:

cl> copy dev$irafhosts ./.irafhosts
The contents of this file are machine dependent. For Suns and other Unix machines, it is:

port = default
auth = default
hiport = default
timeout = default
* <user> <user>           # host list
VAXes, only the host list is used. For Unix systems, the networking parameters are set automatically by the networking system and will rarely need to be modified by the user. PORT may be set to "none" to prevent the use of networking daemons, or to an explicit TCP port number if the default value generated by the networking code cannot be used for some reason. AUTH is an authorization code used to prevent unauthorized access to your networking servers. The value is "default" initially but is filled in by the networking system when networking is first used. For maximum efficiency, AUTH should be the same on all hosts (after using networking for the first time copy the .irafhosts file to your other local hosts). Each user should have a unique AUTH value (the value provided by the system ensures this). HIPORT is used by the networking code to generate PORT. TIMEOUT is the time in seconds after which an idle networking daemon will shut down.

The syntax of the host list is:

hostname : loginname password
There should be one host per line, with the last hostname set to "*" (i.e, match any host). The loginname should be "<user>" (use your local login name), an explicit login name, or "none" to disable networking for that host. The password can be "<user>" (use your local password), and "?" to be queried for the password at run time. If an explicit password is given the REXEC protocol is used, otherwise RSH is used. Usually, you will get a prompt only once for each IRAF session per remote machine per task.

Do not put your password in the .irafhosts file; this is a glaring security risk.

VAX-Specific Details

Most users have a LOGIN.COM file in their root directories so that various system logicals, aliases, etc., are defined during the login procedure. However, you should realize that this command file will be executed for non-interactive sessions as well, including IRAF networking. Therefore, it is important to bypass those portions that would conflict with a network process. Users should place the following lines in their LOGIN.COM file:

! < first line of LOGIN.COM: >
	!	: 	! < contents of LOGIN.COM file > 	!	:
	! < set logicals for IRAF: >

Note the next to the last line above.
This disk and pathname may be different for your site. Consult your site manager if you don't know the location of the IRAFUSER.COM file.

The VAX machine must be running MULTINET if you intend to access it from Unix machines. Network access via DECNET--i.e., to another VAX on the same cluster--is also possible, in which case you can substitute "none" for "<user>" in your host list to avoid being prompted for your password. That is, access by user "kilroy" to the node "AIRY" from "AVION" (if both are VAX machines) would be handled in your AVION host list as:

airy	: kilroy none

Networking Syntax

When referring to files on remote machines, use the syntax node!pathname. The pathname for the remote host and directory can be referred to with IRAF environment variables. This is usually good practice (it helps to avoid typos), but it is often necessary for IRAF networking because wildcards in file names are not expanded if the path begins with a node name. Simply append the "$" character to the environment variable and use it in place of the "node!pathname" syntax.

The pathname is machine-specific, and would look something like the following to refer to a Unix machine (note the trailing "/"):

cl> set sd = sol!/sol/data1/kilroy/galaxies/
cl> dir sd$w*.??h
For a VAX machine, it might look like:

cl> set vd = avion!disk\$data1:\[kilroy.galaxies]
cl> dir vd$w*.??h
Note that special CL characters, such as "$" or "[", must be escaped with a backslash (\).


As mentioned, most IRAF and STSDAS tasks can be used in conjunction with IRAF networking. What follows are a few of the most common tasks that could make use of networking.

   cl> reset node =
   cl> display m51.hhh 1
   cl> devstatus ra!mta
   device ra!mta is not currently allocated
   tape position for ra!mta is undefined
   cl> set sd = sol!/sol/data1/kilroy/galaxies/
   cl> gcopy sd$v*.??h .

This will not work between a Sun and a VAX unless the files are in machine-independent format! (Use sun2vax and vax2sun).

   st> set dvax = scivax!disk\$data1:\[kilroy.galaxies]
   st> sun2vax v*.??h dvax$

Troubleshooting Networking

Very often, when IRAF is unable to establish a connection to a remote machine, the message is obscure or incorrect. For example, if the .irafhosts file is missing or is incorrectly set up, IRAF networking may generate the message "no files found". It is generally a good idea to first use the dir command to be sure that IRAF can see the files in question, before trying to access them over the network.

The Irafhosts File
VAX-Specific Details
Networking Syntax
Troubleshooting Networking

Generated with WebMaker