Astronomy · Linux · Note

IRAF安装笔记 (V2.15.1a Release)

今天刚从兴隆观测实习归来,这次在山上碰到同学在处理超新星的光谱数据(2.16m的BFOSC观测结果),他用的是IRAF(关于IRAF的介绍可以参看:IRAF安装之傻瓜篇 中前几段内容),之前身边的同学做本科论文的时候有人用过IRAF,早已久仰大名,但是因为自己不需要使用,所以也没有安装过。之前,我接触到的都是单天线的毫米波和亚毫米波段的数据,用的都是GILDASSURF等软件,其实对IRAF还很陌生。于是今天回到机房就立即实践安装了一下。

安装之前,我google了一下安装方法,发现结果大多是2006年的,而现在新出的IRAF必然有一些新的或许更加简单的安装方法,于是我去IRAF官网看了看。发现新版本安装比较简单,下面我做个简单描述(我使用的操作系统是32位Linux,该方法可能不适用于Mac OSX):
首先要建立一个文件夹/iraf/iraf用来放置IRAF程序,具体做法是在终端里输入

su

然后输入密码,进入超级用户模式(从这时开始要谨慎操作,注意避免误删文件),然后建立文件夹

cd /
mkdir -p /iraf/iraf

然后从IRAF的ftp上下载V2.15版本的IRAF,通过下面命令放到/iraf/iraf目录下,并解压缩

wget ftp://iraf.noao.edu/iraf/v215/PCIX/iraf-linux.tar.gz
mv ./iraf-linux.tar.gz /iraf/iraf
cd /iraf/iraf
tar -xvf  ./iraf-linux.tar.gz

然后你需要创建iraf用户(注意要给iraf-linux.tar.gz权限),你可以通过图形化的工具(不管什么版本的桌面Linux,都应该有对应的系统管理项),也可以通过命令行输入useradd的方法,iraf用户的目录是/iraf/iraf/local,iraf使用的shell是csh或者tcsh,具体命令是

useradd -s /bin/csh -d /iraf/iraf/local iraf
passwd iraf (回车之后,不要把密码也设置成iraf,密码越复杂越好,笔者曾经因为这个密码遭到过黑客攻击)
sudo chown -R iraf /iraf

然后开始安装:设置环境变量

su - iraf
setenv iraf /iraf/iraf
exit

然后退出csh,在root下运行安装脚本

su
csh /iraf/iraf/unix/hlib/install

然后按照提示安装(基本上是一路回车)。这样基本上IRAF就安装好了。打开终端,输入

su - iraf
cl

出现

NOAO/IRAF PC-IRAF Revision 2.15.1a EXPORT Mon Feb 21 18:54:16 MST 2011
This is the EXPORT version of IRAF V2.15.1a supporting PC systems.

Welcome to IRAF.  To list the available commands, type ? or ??.  To get
detailed information about a command, type `help <command>'.  To run  a
command  or  load  a  package,  type  its name.   Type  `bye' to exit a
package, or `logout' to get out  of the CL.    Type `news' to find  out
what is new in the version of the system you are using.

Visit http://iraf.net if you have questions or to report problems.

The following commands or packages are currently defined:

dataio.     images.     lists.      obsolete.   proto.      system.
dbms.       language.   noao.       plot.       softools.   utilities.

ecl>

就说明IRAF就运行起来了。安装基本告一个段落。

如果你同样使用上面方法安装遇到了问题,也欢迎留言交流~

exit

19 Comments

  1. su – iraf
    setenv iraf /iraf/iraf
    exit

    这一步中,如果是ubuntu的话,得先安装tcsh,然后用tcsh才能设置环境变量。

  2. 最后安装完了,输入cl,出现:Warning: no login.cl found in login directory
    dataio images lists obsolete proto system
    dbms language noao plot softools utilities

    ecl>
    这是咋回事啊

  3. 我在装到这一步时:useradd -s /bin/csh -d /iraf/iraf/local iraf会出现这样的问题bash: syntax error near unexpected token `<'
    这个应该如何解决

        1. 那为什么会提示:bash: syntax error near unexpected token `<' ? 你应该用的是csh而不是bash。

  4. 我用echo $0查看的时候显示的是bash,应该是没错的,但是那个错误依然存在

    1. 我认为错误出在多出一个 < span > 字符串,我之前的代码可能因为兼容问题,多出了这串东东。你重新拷贝运行试试。

  5. 我执行到这一步su
    csh /iraf/iraf/unix/hlib/install
    按了几个enter后出现了这样的错误
    An error occured during verification. Please take corrective action before rerunning the insatll scipt.不知道这个是怎么回事呢

  6. 还有它是出现那个错误,但是我另外打开一个终端,然后输入su – iraf
    后有一个iraf>
    我输入cl说Command not found

  7. root@lmm:/iraf/iraf# csh /iraf/iraf/unix/hlib/install
    程序 ‘csh’ 已包含在下列软件包中:
    * csh
    * tcsh
    请尝试:apt-get install
    这是什么问题啊,该怎么解决?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.