IRAF in a virtual Python

Unless and until PyRAF is added to the Python library sets in MacPorts, it is necessary to install it into one's virtual Python environment; installing PyRAF requires an active IRAF to be available; but SciSoft's IRAF is too entangled with SciSoft's Python libraries to be employed separately. Herewith instructions on how to set up the freestanding 64-bit IRAF, which can be installed from Self-Service if necessary, for this purpose.

PyRAF initialisation aliases

This assumes that you have set up a virtual Python environment, as described in Virtual Python on Astrophysics Macs, complete with virtual-Python launch aliases vpython3-init or vpython2-init as appropriate.

First use:

To take on whichever aliases you've added, you will need to either start a fresh shell session, or say at the shell prompt:

tcsh:

source ~/.cshrc

bash:

. ~/.bashrc

Please note: You only need to do this in shell sessions which are active at the time you add the aliases. Shell startup files are always read and acted upon when the shell starts, but are only read at that point.

Now set up IRAF's login.cl, which needs to be in the current directory for IRAF to find it:

Activate IRAF if necessary:

iraf-init

For each directory in which you're going to use PyRAF, do:

cd directory-nameiraf --init +here

Usage

.... After all that, you can say either one of:

pyraf3-initpyraf2-init (legacy)

.... to initialise the 64-bit IRAF and the appropriate virtual Python environment in one go. This will not, however, actually launch PyRAF:

If you have installed PyRAF into your virtual Python, you can now say pyraf at the command line to launch it.