#!/bin/csh -f #+ # abba -- acquire spectra in an ABBA sequence # # Purpose: # Acquire one or more sequences of four spectra in which the # first and last images are offset to one side of the starting # point, and the second and third lie on the other side. # # Usage: # abba [size [repeats]] # # Arguments: # size = dither size to each side of starting location # [arcsec; default=1.0 arcsec] # repeats = number of times to repeat ABBA pattern [default=1] # # Output: # To stdout # # Retrictions: # Slits must be untilted. # # Side effects: # Marks base before starting exposure sequence # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # 1) Acquire a single ABBA sequence with 1.0-arcsec nods # abba # # 1) Acquire five single ABBA sequences with 1.5-arcsec nods # abba 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/4 (%s) Offset: %+.1f arcsec from base)\n" $i $pos $dx printf "-----------------------------------------------------------------\n" goi end gotobase end # go home... gotobase cat <