Welcome to iraf.net Saturday, May 11 2024 @ 08:45 AM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 Text Cursor
   
ofwolf42
 01/21/2011 07:23PM (Read 3388 times)  
++---
Junior

Status: offline


Registered: 12/24/2010
Posts: 20
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.

 
Profile Email
 Quote
fitz
 01/21/2011 07:23PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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.

 
Profile Email
 Quote
ofwolf42
 01/21/2011 07:23PM  
++---
Junior

Status: offline


Registered: 12/24/2010
Posts: 20
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?

 
Profile Email
 Quote
fitz
 01/21/2011 07:23PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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:1:5a939675b1]task $fixit = /path/fixit.sh[/code:1:5a939675b1]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.

 
Profile Email
 Quote
ofwolf42
 01/21/2011 07:23PM  
++---
Junior

Status: offline


Registered: 12/24/2010
Posts: 20
What about the reverse? Is it possible to run IRAF scripts from an sh file? I can't seem to find anything on it.

 
Profile Email
 Quote
fitz
 01/21/2011 07:23PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
See http://iraf.noao.edu/iraf/web/new_stuff/cl_host.html

 
Profile Email
 Quote
ofwolf42
 01/21/2011 07:23PM  
++---
Junior

Status: offline


Registered: 12/24/2010
Posts: 20
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?

 
Profile Email
 Quote
fitz
 01/21/2011 07:23PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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.

 
Profile Email
 Quote
ofwolf42
 01/21/2011 07:23PM  
++---
Junior

Status: offline


Registered: 12/24/2010
Posts: 20
I read online that using the command::[code:1:5795a58f18]"set stdimcur=text"[/code:1:5795a58f18]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)?

 
Profile Email
 Quote
ofwolf42
 01/21/2011 07:23PM  
++---
Junior

Status: offline


Registered: 12/24/2010
Posts: 20
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?

 
Profile Email
 Quote
   
Content generated in: 0.28 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login