#!/bin/csh -f #+ # grating -- show or select the DEIMOS grating and wavelength # # Purpose: # With no arguments, print the name of the current DEIMOS # grating and its wavelength. With one argument, selects the # named DEIMOS grating. With two arguments, sets the grating # and the grating wavelength. # # Usage: # grating [name [wavelen]] # # Arguments: # name = name of the grating to select # wavelen = wavelength [Angstroms] to set the grating to # # Output: # - With no arguments, the name of the grating is printed # # Restrictions: # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # #- # Modification history: # 2002-Jun-06 GDW Original version #----------------------------------------------------------------------- set buf = $0 set cmd = $buf:t set usage = "Usage: $cmd" # verify args... if ( $#argv > 2 ) then printf "$usage\n" exit 1 endif # grab args... if ( $#argv >= 1 ) then set name = $1 shift endif if ( $#argv >= 1 ) then set wavelen = $1 shift endif if ( $?name ) then # move to grating... modify -s deimot GRATENAM="$name" if ( $status ) then printf "ERROR setting grating slider\n" exit $status endif # optionally tilt the appropriate grating... if ( $?wavelen ) then @ slider = `slider` modify -s deimot G${slider}TLTWAV ="$wavelen" if ( $status ) then printf "ERROR setting grating tilt\n" exit $status endif endif else # default is to simply print grating name show -s deimot -terse GRATENAM endif exit