View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

IRAF v2.16.1 error running a shell script to run IRAF

lau_sev wrote on Mar 24, 2015


Hello,

I've tried to run a shell script which calls IRAF to do some tasks. However, it does not work. When i run it, IRAF is opened and then it gets blocked doing nothing. It does work in computers with IRAF v2.14.1 but i've tried it in two different computers where IRAF v2.16 is installed and it does not work, so I think it has to be related with the version of IRAF installed.

The shell script is the following:

#!/bin/csh

cl -old << acabar

cl < irafmask.cl

logout

acabar

and the irafmask.cl file is this:

wfits(iraf_fil="R_recor.fits.pl",fits_fil="R_recor_mask.fits",scale=no,autosca=no)

It is a quite simple script and I do not understand why it does not work. If someone could hep me... it would be great.

Mike Fitzpatrick wrote on Mar 26, 2015


There were some changes made in the v2.16 startup that can sometimes affect redirected scripts, however your multiple levels of redirection will almost certainly trigger it. The script itself is trivial if all you want to do is call WFITS on a hardwired filename, but you can write a host-CL script to do the same thing just as easily:


#!/iraf/iraf/bin.linux/cl.e -f

dataio             # load the needed package


# get the input args
string  arg1, arg2
print (args) | scan (arg1, arg2)

# Execute the command
printf ("wfits(iraf='%s',fits='%s',scale=no,autosca=no)\n", arg1, arg2) | cl()

logout
 


See http://iraf.noao.edu/iraf/web/new_stuff/cl_host.html for additional details, but basically you could make this script executable and then call it as

% mywfits R_recor.fits.pl R_recor_mask.fits

and it would do the same thing. The trick is in the first line where you need to put the path to the CL binary for your system explicitly, the rest of the script simply sets the environment and then executes the command.

The "cl -old" in your script simply executes the 'cl.e' binary rather than the default, to use the v2.14 binary you'll need to call it explicitly. Hope this helps.


Last post on Mar 26, 2015