Welcome to iraf.net Saturday, May 11 2024 @ 08:17 AM GMT
duvall |
03/08/2006 09:39PM (Read 4507 times)
|
|
|
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
|
|
|
|
fitz |
03/08/2006 09:39PM
|
|
|
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
|
|
|
|
| |
|
Content generated in: 0.07 seconds |
|