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.
The IFU Data-Product Cookbook