Welcome to iraf.net Friday, March 29 2024 @ 03:22 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 IRAF v2.16.1 error running a shell script to run IRAF
   
lau_sev
 03/24/2015 10:05AM (Read 14570 times)  
+----
Newbie

Status: offline


Registered: 10/28/2014
Posts: 3
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.

 
Profile Email
 Quote
fitz
 03/26/2015 07:24PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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:

PHP Formatted Code

#!/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.

 
Profile Email
 Quote
   
Content generated in: 0.13 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login