| Version 6 (modified by , 21 years ago) ( diff ) |
|---|
PyRAF
PyRAF is a new command language for running IRAF tasks that is based on the Python scripting language. It gives users the ability to run IRAF tasks in an environment that has all the power and flexibility of Python. PyRAF can be installed along with an existing IRAF installation; users can then choose to run either PyRAF or the IRAF CL.
More information can be found here. The current release of PyRAF is v1.2 and can be downloaded from here. The release notes can be found here.
Required Supporting Packages
As a convenience all supporting packages are
available [http://www.stsci.edu/resources/software_hardware/pyraf/support_stsci_python/ here].
For our purposes, all packages were available via apt-get.
If you haven't installed all supporting packages, we suggest
that you follow the order in which they are listed below:
* IRAF
* TABLES/STSDAS v3.4
* Tcl/Tk - v8.3 or higher
* Readline
* Python - v2.3 or higher (with readline and _tkinter modules enabled)
* Numeric - v23.8
* libf2c (Note: the package on our web site has a change that allows it to work on 64bit Linux platforms)
* Pmw 1.2
Some platforms have most of these packages already installed in their system directories.
To test whether your Python installation has all modules needed, start Python and try to import them:
%python
>>>import readline
>>>import Tkinter
>>>Tkinter._test()
>>>import Numeric
>>>import Pmw
iraf@metis% python
Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
>>> import Tkinter
>>> Tkinter._test()
>>> import Numeric
>>> import Pmw
If you don't get an ImportError, this means that Tcl, Tk, Readline, Python,
Numeric and Pmw are already installed on the system.
Readline5:
cdelacruz@metis:~$ sudo apt-get install libreadline5
cdelacruz@metis:~$ sudo apt-get install libreadline5-dev
Numeric:
cdelacruz@metis:~$ sudo apt-get install python2.4-numeric
cdelacruz@metis:~$ sudo apt-get install python2.4-numeric-ext
In addition Pydrizzle/Multidrizzle require:
Pmw:
cdelacruz@metis:~$ sudo apt-cache search Pmw
python-pmw - Pmw -- Python MegaWidgets
python-pmw-doc - Pmw -- Python MegaWidgets
cdelacruz@metis:~$
cdelacruz@metis:~$ sudo apt-get install python-pmw
cdelacruz@metis:~$ sudo apt-get install python-pmw-doc
libf2c
cdelacruz@metis:~$ sudo apt-get install python2.4-tk
PyRAF Installation:
Create directory, /usr/local/pyraf/, and uncompress source: cdelacruz@metis:/usr/local/pyraf$ sudo tar xf stsci_python_v2.2.tar iraf@metis% tar -xf stsci_python_v2.2.tar cdelacruz@metis:/usr/local/pyraf$ su iraf Numarray Installation: metis:/usr/local/pyraf> cd stsci_python/numarray-1.4.1 metis:/usr/local/pyraf/stsci_python/numarray-1.4.1> python metis:/usr/local/pyraf/stsci_python/numarray-1.4.1> sudo python setup.py config install --gencode metis:/usr/local/pyraf/stsci_python> sudo python setup.py install --with-f2c=/usr/bin/ PyRAF Setup After a default installation the pyraf startup script is located in the same directory with the python executable, so this directory has to be on the search path. Modify the environment variable $PATH if necessary. If the software was installed in a personal directory, with either "--home=" or "--prefix=", then the startup script is located in /bin. If "--local=", then pyraf's startup script is in /pyraf. In order to run PyRAF conveniently, you can define an alias or create a symbolic link to the startup script. %alias pyraf <install_dir>/bin/pyraf %cd /usr/local/bin (or some other directory on PATH) %ln -s /bin/pyraf pyraf Note for Linux users: There is a problem running iraf on some Linux systems (Fedora, RHEL, possibly others). Quote from the iraf web site: " Specifically, pointers allocated in the normal course of a task may occasionally be at an address outside the user's per-process stack space, resulting in a "memory has been corrupted" or "segmentation violation" error. The workaround is to remove the stacksize limit in the user's shell with a command such as: %limit stacksize unlimited # for tcsh users %ulimit -s unlimited # for bash users As a preventive measure against this problem, the CL startup script was modified to implement this change and so most users who only use IRAF from the CL will not need to take any special action." PyRAF does not use the CL start up script, so you will need to have this command in your unix start up files (for example ~/.login). Testing The Installation After you finish the installation of all packages, you can run the script stsci_python/test22.py to check the integrity and version compatibility of the installation. Note: This script must be run from a directory other than stsci_python, for example your home directory. %cp stsci_python/test22.py ~ %cd %python test22.py
Note:
See TracWiki
for help on using the wiki.
