PRO getsavhd,filename,nimages,utsec,exptimes,bad_image ON_IOERROR,go_on OPENR,hbunit,filename,/GET_LUN hbfile=ASSOC(hbunit,BYTARR(512)) hbstat=FSTAT(hbunit) hbbytes=hbstat.SIZE nimages=hbbytes/66048L PRINT,'There are '+STRTRIM(nimages,2)+' images' hbytes=BYTARR(512,nimages) utsec=LONARR(nimages) exptimes=FLTARR(nimages) FOR i=0L,nimages-1 DO BEGIN hbytes(0,i)=hbfile(129*i) header=gethd(hbytes(*,i)) utsec(i)=3600L*header.misc.tm.hour $ + 60L*header.misc.tm.minute $ + 1L*header.misc.tm.second exptimes(i)=header.misc.exp_scale*header.exp.exposure/1000. IF (i GT 0) AND (i MOD 20 EQ 0) THEN PRINT,i,FORMAT='(I4,$)' IF (i GT 0) AND (i MOD 400 EQ 0) THEN PRINT,FORMAT='()' GOTO,endloop go_on: IF KEYWORD_SET(bad_image) $ THEN bad_image=[bad_image,i] $ ELSE bad_image=[i] endloop: ENDFOR PRINT,FORMAT='()' CLOSE,hbunit FREE_LUN,hbunit IF NOT KEYWORD_SET(bad_image) THEN bad_image=[-1] RETURN END