View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

IMEXAM for loop

ofwolf42 wrote on Feb 14, 2011

I'm calling IMEXAM in a for loop like so::

imexam(  i//".fits" , 1 )


With imagecu set to a co-ordinate text file and defkey set to a. I want the function to call (say) "1.fits", load it to frame 1 in ds9, perform the action "a" at the point(s) given in the text file.

Unfortunately, all it seems to do is load the file, display it then move on to the next statement in the code. I've tried

imexam(i//".fits",1,"a")


and a few other permutations but I can't seem to get the function to perform the required action.

What am I doing wrong?

ofwolf42 wrote on Feb 14, 2011

If it helps, I thought I might give a bit more information::
The coordinate file is::

289 48 logical a


And this works fine when I call IMEXAM from the terminal. I then run my script which is::

for(i=35; i<37; i+=1 )
{
!./centroid
!rm logfile.txt
imexam(i//".fits" , 1)
}

Where centroid is a c++ program that I know for a fact is working just fine. Unfortunately the terminal just says the logfile is open, reads out the z values used and then moves on to the next iteration of the loop.

I can't figure out how I'm supposed to call IMEXAM. Please, any help would be greatly appreciated.

Francisco Valdes wrote on Feb 14, 2011

I think your problem is with your coordinate file. The third column should be 101 (which means frame=1 and tile=01) and not "logical". But even easier, just use the x and y alone. The purpose of the defkey is just so this will work with a simple list of pixel coordinates. Another comment I would make is that it can sometimes cause problems to begin image names with a number because the CL or the task may try and interpret it as a number (in particular something like 35x might be turned into a hex number). In this case it does not matter but as a general rule I recommend not doing it.

Frank Valdes

Last post on Feb 14, 2011