#!/bin/csh -f #+ # gratecal -- recalibrate the tilt for the current grating # # Purpose: # Home the currently-selected grating tilt stage and reset the # grating tilt offset to zero. # # Usage: # gratecal # # Arguments: # None # # Output: # To stdout # # Restrictions: # Grating must be selected (i.e., clamped up in the beam) # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # #- # Modification history: # 2007-Jun-19 GDW Original version #----------------------------------------------------------------------- set buf = $0 set cmd = $buf:t set usage = "Usage: $cmd" # verify args... if ( $#argv > 0 ) then printf "$usage\n\a" exit 1 endif # determine the current slider... set slider = `slider` # validate slider... if ( "$slider" != "3" && "$slider" != "4" ) then printf "[$cmd] ERROR: can't run this command on slider '$slider' -- abort!\n\a" exit 1 endif # re-home... set keyword = g${slider}tltcal modify -s deimot $keyword=1 if ( $status ) then printf "[$cmd] ERROR: unable to home grating tilt on slider $slider -- abort!\n\a" exit 1 endif # reset grating tilt offset... set keyword = g${slider}tltoff modify -s deimot $keyword=0 if ( $status ) then printf "[$cmd] ERROR: unable to reset grating tilt offset on slider $slider -- abort!\n\a" exit 1 endif exit