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 

Text Cursor

 
Post new topic   Reply to topic    iraf.net Forum Index -> Applications
View previous topic :: View next topic  
Author Message
ofwolf42
Active IRAF User


Joined: 24 Dec 2010
Posts: 20

PostPosted: Fri Jan 21, 2011 7:23 pm    Post subject: Text Cursor Reply with quote

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.
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Mon Jan 24, 2011 9:55 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ofwolf42
Active IRAF User


Joined: 24 Dec 2010
Posts: 20

PostPosted: Wed Jan 26, 2011 11:29 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Fri Jan 28, 2011 6:47 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ofwolf42
Active IRAF User


Joined: 24 Dec 2010
Posts: 20

PostPosted: Tue Feb 01, 2011 4:01 pm    Post subject: Reply with quote

What about the reverse? Is it possible to run IRAF scripts from an sh file? I can't seem to find anything on it.
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Tue Feb 01, 2011 4:26 pm    Post subject: Reply with quote

See http://iraf.noao.edu/iraf/web/new_stuff/cl_host.html
Back to top
View user's profile Send private message
ofwolf42
Active IRAF User


Joined: 24 Dec 2010
Posts: 20

PostPosted: Mon Feb 07, 2011 7:59 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Tue Feb 08, 2011 12:30 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ofwolf42
Active IRAF User


Joined: 24 Dec 2010
Posts: 20

PostPosted: Tue Feb 08, 2011 8:43 am    Post subject: Reply with quote

I read online that using the command::

Code:
"set stdimcur=text"


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)?
Back to top
View user's profile Send private message
ofwolf42
Active IRAF User


Joined: 24 Dec 2010
Posts: 20

PostPosted: Tue Feb 08, 2011 8:03 pm    Post subject: Reply with quote

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?
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.10 seconds