#!/bin/csh -f #+ # align_check -- check slitmask alignment between spectral exposures # # Purpose: # Tilt the grating to the zeroth-order imaging position and # acquire a direct image with the current filter to check # slitmask alignment in between spectral exposures. If # started while an exposure is in progress, the script will # wait for the current exposure to finish before reconfiguring # the grating. The observer must run xbox in and IRAF session # on the resulting image to correct pointing. # # The script reconfigures DEIMOS for spectroscopy immediately # after the image starts reading out on the assumption that only # a small shift will be required to fix the alignment. If a # significant shift or a significant rotation is recommended by # xbox, then the script should be re-run to verify alignment # following the move. # # Usage: # align_check [-n] [ttime] # # Arguments: # ttime = exposure time for alignment check # # Flags: # -n = noquery mode # # Restrictions: # - Can only be used when slider 3 or 4 is in use # # Procedure: # - Wait for any ongoing image to complete # - Configure DEIMOS for zeroth order imaging on the current slider # - Acquire a direct image of the specified integration time # to check slitmask alignment and wait for readout to commence # - Reconfigure spectrograph to spectroscopy mode settings # - Verify proper reconfiguration # - Pause until observer has sent moves # - Wait for FCS to begin tracking # - Launch a new exposure # # Time requirements: # - completes in 2:05, assuming 20 second exposure time # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # 1) Make an alignment check using default exposure time: # align_check # # 2) Make an alignment check using longer exposure time: # align_check 40 #- # Modification history: # 2002-Aug-12 GDW Original version # 2002-Aug-13 GDW Extended to grating 4 # 2003-Mar-26 GDW Added check for FCS tracking # 2003-Apr-24 GDW Modified for slider 4 zeroth order # 2012-May-29 GDW Added noquery option and put goi in background # 2012-Dec-12 GDW Wait for exposure to start before exit #----------------------------------------------------------------------- # prelims... set buf = $0 set cmd = $buf:t set usage = "Usage: $cmd [ttime]" set query = 1 # set defaults... set ttime = 20 # parse flags... while ( $#argv > 0 ) # check for -noquery flag... if ( "$1" =~ -n* ) then printf "NOQUERY MODE ENABLED\n" set query = 0 shift continue endif # check for bad flag... if ( "$1" =~ -* ) then printf "[$cmd] ERROR: invalid option '$1' -- abort!\n\a" exit 1 endif # exit flag check if no flags remain... break end # verify args... if ( $#argv > 1 ) then printf "$usage\n" exit 1 endif # parse args... if ( $#argv >= 1 ) then set ttime = $1 shift endif cat < 1 ) exit 3 # query whether to try again... if ( $query == 1 ) then printf "Try again? (y/n) [y]: " set ans = $< if ( "$ans" == "" || "$ans" == "y" || "$ans" == "Y" ) then printf "Trying again...\n" else exit 3 endif endif end object "$old_object" # open the shutter to allow FCS to lock... modify -s deifcs fcsmode=$old_fcsmode modify -s deiccd cshutter=open # exit here in noquery mode... if ( ! $query ) then exit endif # pause until FCS is working again... cat <