Posted: Fri Jan 21, 2011 7:23 pm Post subject: Text Cursor
I've been trying to read up on text cursors on IRAF. I want to use imexam as part of a script and perform automated processes on a series of images. Most information talks about using "fscan" to get the current position and store the co-ordinates as variables. I want to know how to feed these variables into a function (such as imexam). Is this possible?
Also is it possible to script imexam commands? Such as the "a" keystroke or similar.
You didn't say specifically what you've been reading, but see section 3.7 of "cl> help cursors" for the description of a coordinate input file. This is what you would use to pass in e.g. the 'a' command to imexam in a batch mode.
Note that many of the functions in imexam have task equivalents (e.g. the 'a' key could be done with apphot tasks). If you still have questions, please post an example of what you're trying to do.
So using a text file of co-ords I can pass a position to an iraf function. What I want to do now is edit that text file within a script.
What I want to do is get the co-ords of the center of an object (from apphot or imexam etc) add that co-ord to a text file then move to the next image, then use apphot "center" function or imexam "a" function at the co-ord that was added to the text file and repeat the process over a series of images.
Problem is that the only way I know how to extract the co-ord from the log file and enter into a text file is using c++ programs or (maybe with some practice) a UNIX script. Is it possible to run a .sh file within an IRAF script?
Host programs can be used in scripts by declaring them as 'foreign tasks', e.g. in your login.cl you would declare a task as e.g.
Code:
task $fixit = /path/fixit.sh
Otherwise I'm not clear on exactly how you're creating the coords files, but I can imagine a loop that get the coords and write out the new coord file each time it is needed.
Okay, so I set stdimcur to text then functions expect a text input. When I run imexam it expects a user text input. How do I pass a co-ord list to it? Is there a parameter I can change in imexam so it always looks in the same file for co-ords?
Do you mean you set the 'stdimcur' environment variable to the name of a cursor file, or actual text values? A task like IMEXAM has it's own 'imagecur' parameter which must also be set to a cursor file.
A cursor file contains simply "x y wcs key" values one per line, how you convert your coordinate lists into this format is up to you.
that it was then possible to pass text files to functions. Is this not needed for IMEXAM? Can I just epar the 'imagecur' to a file name with the appropriate values and it will then use those values automatically?
Will it still ask for the user to input which display layer to use (when using DS9)? If so, is there a way to tell it which layer when calling the function (for the sake of a script)?
Okay, I've got IMEXAM reading in the co-ord file but it's not giving me the same values that I get when I perform the same action with the mouse and keyboard. Is there some kind of offset I'm not accounting for? The wcs is set to "logical" in both IMEXAM's parameters and in the co-ord file. I assumed that this was the same system that DS9 displays, am I wrong?
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