Welcome to iraf.net Thursday, March 28 2024 @ 05:05 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 executing cursor mode commands from a script
   
duvall
 03/08/2006 09:39PM (Read 4499 times)  
+++--
Chatty

Status: offline


Registered: 03/08/2006
Posts: 59
I wanted to be able to execute cursor mode commands from a script. I could not figure out how
to do it from reading 'help cursors'. One thing I wanted to do was to execute graph from a script
and then execute the gcur T command to put some text at a specified location (in wcs coords) in
the plot. How do I do this? Or, is there a better place to read about this?
Thanks.
Tom

 
Profile Email
 Quote
fitz
 03/08/2006 09:39PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Tom,
It can be done, but not the way you think. The cursor mode commands (i.e. the upper-case and ":." commands) are handled by the CL stdgraph kernel during the cursor read, but when you redirect the cursor in a file this gets treated as any other list-directed parameter. The plotting task queries for the cursor and gets back a string like 128.0 128.0 1 A(to redirect the 'A' key for instance), however this command is now being processed by the task command loop. None of the applications are expecting the cursor mode commands and so this is an unrecognized command handled by whatever the default case is. So, how to do this? If all you want is to label text then there is a little-known utility in STSDAS called RC to do this. For example, suppose you finish with whatever plotting task you use and the plot window remains on the screen. You would then create a cursor file called "/tmp/cmds" 100.0 100.0 1 :test
200.0 200.0 1 :test2
0.0 0.0 1 qYou'd then call RC to draw the 'test' and 'test2' labels as cl> rc coords="/tmp/cmds"and the labels with be appended to the plot. The source code for RC could be expanded a bit to implement other cursor mode functionality (e.g. the 'D" to draw a line would be handy), but this is a cheap way to add labels anyway. Note it works because of the reasons explained above, the ':' could just as easily have been a 'T'
followed by the string. Alternatively you could use tasks like IGI or you own modified RC to append text/graphics. Hope this helps.Cheers,
-Mike

 
Profile Email
 Quote
   
Content generated in: 0.09 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