#!/bin/csh -f #+ # ab -- acquire spectra in an AB sequence # # Purpose: # Acquire one or more sequences of two spectra in which the # images are offset to either side of the starting point # # Usage: # ab [size [repeats]] # # Arguments: # size = dither size to each side of starting location # [arcsec; default=1.0 arcsec] # repeats = number of times to repeat AB pattern [default=1] # # Output: # Transcript written to stdout # # Side effects: # Marks base before starting exposure sequence # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # 1) Acquire a single AB sequence with 1.0-arcsec nods # ab # # 1) Acquire five AB sequences with 1.5-arcsec nods # ab 1.5 5 #- # Modification history: # 2014-Jan-31 GDW Original version #----------------------------------------------------------------------- set cmd = `basename $0` set usage = "Usage: $cmd" ## set debug = 1 # defaults... @ niter = 1 set nod = 1.0 # first arg is nod size... if ( $#argv >= 1 ) then set nod = $1 shift endif # second arg is repeats... if ( $#argv >= 1 ) then @ niter = $1 shift endif # no more args allowed... if ( $#argv >= 1 ) then printf "$usage\n\a" exit 1 endif # disable moves in debug mode... if ( $?debug ) then alias markbase echo markbase alias gotobase echo gotobase alias mx echo mx alias goi echo goi alias is_float echo endif # confirm that the nod is a legal number... is_float $nod > /dev/null if ( $status != 0 ) then printf "[$cmd] ERROR: nodsize $nod is not a legal numerical value -- abort!\n\a" exit 1 endif # verify that nod is positive... set nod = `calc "abs($nod)"` cat < 1 ) then printf "Iteration: %d/%d " $k $niter endif printf "Nod position: %d/2 (%s) Offset: %+.1f arcsec from base)\n" $i $pos $dx printf "-----------------------------------------------------------------\n" goi end gotobase end # set this to indicate success... set outcome = completed abort: if ( ! $?outcome ) then printf "[$cmd] Abort received -- returning telescope to base position\n\a" gotobase set outcome = aborted endif cat <