#!/bin/csh -f #+ # rotatcal -- home (calibratre) the DEIMOS rotator # # Purpose: # # Usage: # # Arguments: # # Output: # # Restrictions: # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # #- # Modification history: # 2004-Oct-08 GDW Original version # 2014-Apr-30 GDW Add check for locked rotator #----------------------------------------------------------------------- set cmd = `basename $0` set usage = "Usage: $cmd" # verify args... if ( $#argv > 0 ) then printf "$usage\n" exit 1 endif # confirm... set default = n printf "ARE YOU SURE you want to home the DEIMOS rotator? (y/n) [$default]: \a" set ans = $< if ( "$ans" !~ y* ) then printf "[$cmd] Aborted by user request.\n\a" exit 1 endif # check for locked rotator... set rotatlck=`show -s deirot -terse rotatlck` if ( $status ) then printf "[$cmd] ERROR: can't read ROTATLCK keyword\n\a" exit 1 endif if( "$rotatlck" != "UNLOCKED" ) then set default = n printf "DEIMOS rotation is locked. Is it okay to unlock? (y/n) [$default]: " set ans = $< if ( "$ans" !~ y* ) then printf "[$cmd] Aborted by user request.\n\a" exit 1 endif modify -s deirot rotatlck=unlocked endif # perform the operation... modify -s deirot rotatcal=1 exit