Welcome to iraf.net Thursday, May 02 2024 @ 09:50 AM GMT
figueira |
01/15/2007 12:51PM (Read 4608 times)
|
|
|
Status: offline
Registered: 11/29/2006
Posts: 16
|
Hello!I'm trying to make my reduction programs a little bit robust in order to share them with my team members. I'm starting to use tasks such as "defpac" in my scripts and I have a few problems.
Here is my file for "def_test.cl"def_test.cl:#######################################################################
# start task with
# task $def_test ="/Users/pedrofigueira/iraf/scripts/DRACS/def_test.cl"
#######################################################################if (! defpac("images.imutil")) {
print("Package not present.")
bye
}
;
imheader.longheader=yesEOFIt exhibits a strange behaviour. When I run it, it enters in the if block even if I have the package loaded. Why is this? Am I using correctly the defpac task? I really don't understand it...
I am using IRAF2.13 in a macintel.All the best and thank you for the help!Pedro Figueira
|
|
|
|
fitz |
01/15/2007 12:51PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
The defpac() function is expecting only the package name, not the path to the package, e.g. "if (! defpac('imutil')" should do what you want. Note that packages are loaded by default both in your login.cl file and perhaps in other package loading scripts (i.e. 'images' is loaded by login.cl, 'imutil' is then loaded automatically when IMAGES is loaded).Cheers,
-Mike
|
|
|
|
figueira |
01/15/2007 12:51PM
|
|
|
Status: offline
Registered: 11/29/2006
Posts: 16
|
Thank you for the advice. I'm realyy sorry to be such a die-harder, but it still doesn't work. I'll show you how I use it and the errors that ocurred. ecl> task $def_test ="/Users/pedrofigueira/iraf/scripts/DRACS/def_test.cl"
ecl> def_test
** Syntax error, line 6
**: if (! defpac("imutil")) {
^
Package not present.
ecl> imheader.longheader=yes
ecl> As you see the package was loaded (as we can confirm from the last command on the command line) but the task execution gave a strange error and printed the message as if it wasn't.
Do you have any other ideas?
Anyway, thank you very much for your effort.All the best,Pedro
|
|
|
|
fitz |
01/15/2007 12:51PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Try using [code:1:6669070a54]if (defpac("images") == no) ......[/code:1:6669070a54], I'm not quite sure why the '!' isn't being accepted.-Mike
|
|
|
|
figueira |
01/15/2007 12:51PM
|
|
|
Status: offline
Registered: 11/29/2006
Posts: 16
|
Excellent, it worked! I think I understand what you mean.
But note that I followed this programming schemme because I found it in the document:An Introductory User’s Guide to IRAF Scripts, by Ed Anderson (page 21)Thank you very much!Pedro
|
|
|
|
| |
|
Content generated in: 0.16 seconds |
|