Submit a Story  :  IRAF Links  :  Past Polls  :  Calendar  :  Advanced Search  
     iraf.net
FAQ
 Forum FAQForum FAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mysterious error with IMALIGN called by a script

 
Post new topic   Reply to topic    iraf.net Forum Index -> Applications
View previous topic :: View next topic  
Author Message
angus



Joined: 20 Jul 2010
Posts: 3

PostPosted: Fri Apr 08, 2011 4:24 am    Post subject: mysterious error with IMALIGN called by a script Reply with quote

I wrote a quite complex script for NIR image reduction.
Now I have modified a row in it, and I am getting a mysterious error message that I am completely baffled with.
Let's say that I do some things with images in the first part of the code that lead to a set of images. I perform imalign on this set of images in the middle of the code and get an aligned image. I then perform some other things on that image in the second part of the code.
Now I modify a line in the *second* part of the code, i.e., a few hundred lines after calling imalign, in a part that has nothing to do with imalign's arguments, and I get this error:

ERROR: ambiguous parameter `' within `<searchpath>'
"if (tmp == "Shifts") {"
line 47: immatch$imalign.cl
called as: `imalign (input=@input.lst, reference=nirobj_dith1.fits, coords=ref.pos, output=@output.lst, shifts=shifts.dat)'
"imalign ("@"//inlst, dimg1, coofile, "@"//outlst, shifts="shifts.dat)"
line 400: custom$script.cl
called as: `script (mode=h)'

It looks like the error is in line 47 of imalign.cl, but how does this whole thing make sense? Of course I checked everything with the code, and found no problems. Again, the above error was invoked by a modification in my code in a part well after calling imalign, in a line that is completely independent from it.
And of course if I run imalign in command line with exactly the same arguments, it works without error.

I am suspicious that this is some serious bug in the parser, and I have no idea what to do.

If anyone could make a suggestion, I would really much appreciate.

Cheers,
Angus
Back to top
View user's profile Send private message
valdes
IRAF Guru


Joined: 11 Nov 2005
Posts: 676

PostPosted: Wed May 04, 2011 7:40 pm    Post subject: Reply with quote

The ambiguous parameter message usually means that you are using an undeclared variable which matches with something in the package or the cl. This could also happen when you accidentally have a typo such that a variable is an abbreviation that matches a variable in your script and in the cl.

However, the error you show doesn't seem to be naming a real variable so maybe a comment marker is missing in a comment. If you want to send the script (valdes@noao.edu) I might be able to deduce the source of the error.

The failure trace you should is probably not really relevant to the error you are showing.

Frank Valdes
Back to top
View user's profile Send private message
angus



Joined: 20 Jul 2010
Posts: 3

PostPosted: Wed May 04, 2011 7:57 pm    Post subject: Reply with quote

Dear Frank,

Thanks for your message.
Your suggestion is logical, but how can all this happen if I start getting this error after some modifications I made on a working code, all of these being hundreds of lines *after* the stuff with imalign?
Anyway, I solved the problem by just embedding the relevant code from imalign into my own program. Everything works now, with the same set of variables.
And the mystery remains...
Confused

Cheers,
A.
Back to top
View user's profile Send private message
valdes
IRAF Guru


Joined: 11 Nov 2005
Posts: 676

PostPosted: Wed May 04, 2011 8:04 pm    Post subject: Reply with quote

The computer interpretation of a script is always logical Smile but understanding what it was actually doing can seem mysterious. The ambiguous parameter error is one that is often less than obvious but is usually easily fixed with a variable declaration even if it seems it should not be necessary.

I'm glad it is working and we can let it slide.

Frank
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    iraf.net Forum Index -> Applications All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2009 phpBB Group
 Copyright © 2005-2011 iraf.net
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.12 seconds