#!/bin/csh -f #+ # goi_wffcs_loop -- exposure loop with fcs tracking # # Purpose: # Wait for FCS to begin tracking, then acquire several exposures # as specified by the default or the input parameter. For short # exposures 30s or less, FCS will sometimes not have enough time # between images to take data. So to ensure that FCS tracks consistently, # this script will loop over a specified number of exposures and then # allow FCS to track before starting another exposure sequence. The # script was developed for programs with long series (100 images) # with relatively short exposures 30s. # # Usage: # goi_wffcs_loop [interval [nexp]] # # Arguments: # internval = number of exposures between wffcs [default=10] # nexp = total number of science exposures to acquire [default=inf] # # Output: # None # # Restrictions: # Note that this runs in an infinite loop. So to stop, you must # control C the script. # # Example: # 1) Acquire exposures in infinite loop with a pause after every 10 # exposures to allows FCS to track. # goi_wffcs_loop # # 2) Acquire 100 exposures with a pause after every 5 # exposures to allows FCS to track. # goi_wffcs_loop 5 100 # #- # Modification history: # 2013-Dec-13 MK/GDW Original version #----------------------------------------------------------------------- set cmd = `basename $0` set usage = "Usage: $cmd [interval [nexp]]\nDefault is to run 'wffcs; goi 10' with the current exposure parameters\n" @ interval = 10 @ nexp = -1 # verify args... if ( $#argv > 2 ) then printf "$usage\a" exit 1 endif # parse args... if ( $#argv >= 1 ) then @ interval = $1 shift endif # parse args... if ( $#argv >= 1 ) then @ nexp = $1 shift endif # start loop... @ count = 0 while ( 1 ) # pause if image in progress... wfi -nowait # open the shutter to allow FCS to track... printf "Opening shutter..." modify -s deiccd cshutter=1 silent # wait for fcs exposure to complete... printf "wait for FCS readout..." wfifcs -silent # wait for tracking... printf "wait for FCS tracking..." wffcs printf "OK\n" # acquire science exposures... goi $interval # increment exposure count... @ count += $interval # check for quit... if ( $nexp > 0 ) then if ( $count < $nexp ) then printf "Completed $count of $nexp exposure sequence.\n" else printf "Completed $nexp exposure sequence.\n" beep 3 break endif endif end