#!/bin/csh -f #+ # gmov -- move an object to a given position on the DEIMOS guider # # Purpose: # Given the starting pixel coordinates of an object on a # DEIMOS guider image, and destination coordinates, # compute and apply the required telescope move to reposition # the object as desired. # # Usage: # gmov [-n] x1 y1 x2 y2 # # Arguments: # -n = no move, only print the required shift # x1 = starting column location of object [pixels] # y1 = starting row location of object [pixels] # x2 = ending column location of object [pixels] # y2 = ending row location of object [pixels] # # Output: # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # 2 = arguments not valid floating-point numbers # # Example: # 1) Move a target at guider pixel (100,200) to pixel (300,400): # gmov 100 200 300 400 # # 2) Display the telescope move required to shift a target at # pixel (100,200) to the pixel (300,400) without moving the telecope: # gmov -n 100 200 300 400 #- # Modification history: # 2002-Jul-06 GDW Original version #----------------------------------------------------------------------- # check for no-move flag... if ( "$1" == "-n" ) then set string = "Required shift is" set move = 0 shift else set string = "Moving" set move = 1 endif # check args... if (${#argv} != 4) then echo "Usage: gmov [-n] x1 y1 x2 y2" exit 1 endif # verify floating-point values... is_float $* > /dev/null if ( $status ) then echo "ERROR: Arguments must be valid floating-point numbers" exit 2 endif # set scale... source $DEIMOS_PROC_DIR/tel/set_scale # apply shift... set dx = `calc "$gscale * ($1 - $3)"` set dy = `calc "$gscale * ($4 - $2)"` echo "$string $dx arcsec in x and $dy arcsec in y" if ( $move) gxy $dx $dy