Posted: Fri Apr 08, 2011 4:24 am Post subject: mysterious error with IMALIGN called by a script
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.
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.
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...
The computer interpretation of a script is always logical 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.
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