#!/bin/csh -f #+ # mxy -- move telescope in instrument (detector) coordinates # # Purpose: # Offset the telescope a given number of arcsec in the # coordinate system of the DEIMOS detector. The offset is # relative to the current coordinaets by default; the optional # flag "-abs" causes the move to be made relative to the base # coordinates; i.e., an absolute move. # # Usage: # mxy [-D] [-n] [-abs] x y # # Arguments: # -D = debug mode # -n = no-action mode; only print move to be made # -abs = flag specifying that the move should be relative to # BASE position, rather than current position # x = offset in the direction parallel with CCD rows [arcsec] # y = offset in the direction parallel with CCD columns [arcsec] # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # 1) Move telecope 10 arcsec along rows and -20 arcsec along columns: # mxy 10 -20 # Note that since this is a *telescope* move, the target will # "move" in the OPPOSITE direction! # # 2) Move telecope 10 arcsec along rows and -20 arcsec along columns: # mxy 10 -20 # Note that since this is a *telescope* move, the target will # "move" in the OPPOSITE direction! #- # Modification history: # Date unknown RWG Original version # 2000-Jul-05 GDW Added documentation # 2002-Aug-11 GDW Added "-abs" feature # 2013-Oct-04 GDW Added wftel # 2014-Feb-25 GDW Added test mode # 2014-Mar-27 MK Modified to use rel2curr=t instead # of rel2base=f. Also re-inserted # wftel at end that luca commented out # on 2014-March -26 #----------------------------------------------------------------------- set buf = $0 set cmd = $buf:t set usage = "Usage: $cmd [-D] [-n] [-abs] x y" # check for flags... while (1) if ( "$1" == "-D" ) then echo "[$cmd] DEBUG mode enabled" set debug shift endif if ( "$1" == "-n" ) then set testmode shift endif if ( "$1" == "-abs" ) then set abs shift endif break end # check args... if (${#argv} != 2) then printf "$usage\n" exit 1 endif # Grab the current value of autpause... set autresum = `wftel -p` # effect the move... set x = $1 set y = $2 if ( $?abs ) then set cmd = "modify -s dcs silent instxoff=$x instyoff=$y rel2base=t" else set cmd = "modify -s dcs silent instxoff=$x instyoff=$y rel2curr=t" endif if ( $?testmode ) then echo Move command is $cmd else $cmd endif # wait for guider update... if ( $?debug ) then set arg = "-D" else set arg = "" endif wftel $arg $autresum exit