#!/bin/csh -f #+ # rotang -- set/show physical DEIMOS rotator angle # # Purpose: # With no arguments, show the current DEIMOS rotator angle in the # DEIMOS coordinate system (which is approximately 90 deg off of # the rotator angle shown on FACSUM). With one numeric argument, set the # rotator to the specified physical rotator angle. # # Usage: # rotang [angle] # # Arguments: # angle = rotator angle [degrees] # # Output: # Current or new rotator angle [degrees] # # Restrictions: # - DEIMOS rotation must be enabled for moves to work # - DEIMOS must be under observer control, not DCS control # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # 1) Show the current rotator angle # rotang # # 2) Set the rotator angle to 123.45 (DEIMOS physical system): # rotang 123.45 #- # Modification history: # 2003-Aug-25 GDW Original version #----------------------------------------------------------------------- set buf = $0 set cmd = $buf:t set usage = "Usage: $cmd [angle]" # verify args... if ( $#argv > 1 ) then printf "$usage\n" exit 1 endif # take appropriate action... if ( $#argv == 0 ) then show -s deirot -terse rotatval exit else # validate argument... set angle = $1 is_float $angle > /dev/null if ( $status != 0 ) then printf "$usage\n" exit 1 endif # cxheck whether instrument rotator is locked... set rotatlck=`show -s deirot -terse rotatlck` if( $status ) then printf "ERROR: can't read ROTATLCK keyword\n" exit 1 endif if( "$rotatlck" != "UNLOCKED" ) then printf "ERROR: DEIMOS rotation system is locked\n" exit 1 endif # check for Pos mode... set rotatmod = `show -s deirot -terse rotatmod` if( $status ) then printf "ERROR: can't read ROTATMOD keyword\n" exit 1 endif if( "$rotatmod" != "Pos" ) then printf "ERROR: DEIMOS rotator is not is Pos mode\n" exit 1 endif # move the beast... modify -s deirot rotatval=$angle if( $status ) then printf "ERROR moving rotator\n" exit 1 endif endif exit