#!/bin/csh -f #+ # wavelen -- set/show the wavelength on the current slider # # Purpose: # With no arguments, show the wavelength of the currently # installed grating. With one argument, set the current grating # wavelength to the specified value. # # Usage: # wavelen [lambda] # # Arguments: # lambda = wavelength to select, in Angstroms # # Output: # Written to stdout # # Restrictions: # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # #- # Modification history: # 2002-Aug-26 GDW Original version #----------------------------------------------------------------------- set buf = $0 set cmd = $buf:t set usage = "Usage: $cmd [lambda]" # verify args... if ( $#argv > 1 ) then printf "$usage\n" exit 1 endif # parse args... if ( $#argv >= 1 ) then set lambda = $1 shift endif # determine the current slider... @ slider = `slider` if ( $slider != 3 && $slider != 4 ) then printf "ERROR -- can only use this command when slider 3 or 4 is in\n" endif # set if lambda is defined, otherwise show... if ( $?lambda ) then modify -s deimot g${slider}tltwav=$lambda else show -s deimot -terse g${slider}tltwav endif