#!/bin/csh -f #+ # level_check -- acquire a quick DEIMOS image to check exposure levels # # Purpose: # Snaps an image only a few rows in height without disk write, # centered on the direct readout window # # Usage: # level_check [n_lines [ttime] ] # # Arguments: # n_lines = number of CCD lines to read out [default=100; min=10] # ttime = exposure time [default = 1 sec] # # Output: # Transcript to STDOUT # # Restrictions: # None # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # 1) Acquire a 1 sec image reading out 100 rows: # level_check # # 2) Acquire a 1 sec image reading out 10 rows: # level_check 10 # # 3) Acquire a 10-sec image reading out 50 rows: # level_check 50 10 #- # Modification history: # 2002-Oct-13 GDW Original version # 2002-Oct-14 GDW Added minimum width parameter # 2002-Oct-28 GDW Reduced minwidth to 10; added onintr # 2003-Jul-31 GDW Added AUTOPANE support #----------------------------------------------------------------------- set buf = $0 set cmd = $buf:t set usage = "Usage: $cmd [n_lines [ttime]]" @ minwidth = 10 # verify args... if ( $#argv > 2 ) then printf "$usage\n" exit 1 endif # optional arg #1 is the number of lines to read out... if ( $#argv >= 1 ) then @ width = $1 shift else @ width = 100 endif @ half_width = $width / 2 # optional arg #2 is the integration time... if ( $#argv >= 1 ) then set ttime = $1 else set ttime = 1 endif # validate args... if ( $width < $minwidth ) then printf "ERROR -- readout window must include at least $minwidth rows.\n" exit 2 endif # get the current window setup... set buf = `show -s deiccd -terse window` @ chip = $buf[3] @ xstart = $buf[5] @ ystart = $buf[7] @ xlen = $buf[9] @ ylen = $buf[11] # locate the center row... @ yc = $ystart + $ylen / 2 # define new starting and ending rows... @ y1 = $yc - $half_width # save old parameters... set old_mosmode = `show -s deiccd -terse mosmode` set old_ttime = `show -s deiccd -terse ttime` set old_autopane = `show -s deiccd -terse autopane` # reset the readout window... onintr quit modify -s deiccd ttime=$ttime modify -s deiccd MOSMODE=Direct modify -s deiccd window=$chip,$xstart,$y1,$xlen,$width modify -s deiccd AUTOPANE=manual # take exposure without disk write... goibuf beep # restore settings: quit: modify -s deiccd ttime=$old_ttime modify -s deiccd MOSMODE=$old_mosmode modify -s deiccd window=$chip,$xstart,$ystart,$xlen,$ylen modify -s deiccd AUTOPANE=$old_autopane exit