next up previous
Next: How do I overplot contours from one image on to another?
Up: Writing csh scripts
Previous: How do I get pixel positions using the cursor?

How do I get real world co-ordinate positions using the cursor?

A similar, but slightly easier, problem is to grab real world co-ordinates from a cursor click on a graphics display window.

   # Grab one position.
   cursor showpixel=true style="Colour(marker)=3" plot=mark \
          maxpos=1 marker=2 device=xwin > /tmp/cursor_lock

   # Wait for cursor input.	  
   while ( ! -e /tmp/cursor_lock )
      sleep 1
   end
   rm -f /tmp/cursor_lock
   
   # Retrieve WCS co-ordinates.
   set pos = `parget lastpos cursor`
   set x = $pos[1]
   set y = $pos[2]

Here we run the cursor application, again creating a lock file to stop further execution of the script. We then delete the lock file and retrieve the cursor position using parget.

This functionality has been encapsulated within the script $DATACUBE_DIR/getcurpos.csh.



next up previous
Next: How do I overplot contours from one image on to another?
Up: Writing csh scripts
Previous: How do I get pixel positions using the cursor?

The IFU Data-Product Cookbook
Starlink Cookbook 16
A. Allan & Malcolm J. Currie
2008 July 4
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council