;+ ; NAME: DRKCHKZ ; ; PURPOSE: ; This procedure determines which dark images, aquired by ; camera 0 have been corrupted. ; ; CATEGORY: ; ; CALLING SEQUENCE: ; DRKCHKZ,FILES,OUTFILES,COUNT ; ; INPUTS: ; FILES: A STRING ARRAY of dark image file names. ; ; KEYWORD PARAMETERS: ; None. ; ; OUTPUTS: ; OUTFILES: A STRING ARRAY names of dark images that have ; not been corrupted. ; ; COUNT: The number of file names returned by OUTFILES ; ; ONE FILE ; c:\idl\data\dark\date.tmz: This file contains the date and ; time at which each of the 'good' files from camera one ; were aquired. ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; None. ; ; RESTRICTIONS: ; This procedure expect that all files come from the same path. ; ; PROCEDURE: ; This procedure is used to determine what darkframes,aquired ; by camera 0, with filenames listed in the STRING ARRAY, FILES ; have been corrupted. It use the array 'limit', which is idexed ; by CCD temperature, to set an interval in which the means of ; the images of "good" darkframes will appear. This interval is ; the individual element in the array 'limit' to the element ; minus twenty. To determine the upper limits in 'limit' about 450 ; darkframes where looked at. Where zeros occur in 'limit' ; corresponds to CCD temperatures at which not enough( or no) ; images where aquired to confidently set an upper limit. ; Consequently, all darkframes with images gathered at these ; temperatures will be ignored. All, darkframes that are found ; to be "good", will have their filenames returned in the STRING ; array 'outfiles'.The variable 'count' will pass back the number ; of "good" files. Finally, the date and time at which each of the ; "good" files were aquired are converted to julian seconds and ; stored in the file 'c:\idl\data\dark\date.tmz'. ; ; MODIFICATION HISTORY: ; Written May 1994, by T A Oliynyk ;- PRO drkchkz,files,outfiles,count infile=FINDFILE('c:\idl\data\dark\date.tmz',count=count) IF count EQ 0 THEN BEGIN OPENW,unit,'c:\idl\data\dark\date.tmz',/GET_LUN initial=ASSOC(unit,DBLARR(1)) initial(0)=[0] CLOSE, unit FREE_LUN,unit ENDIF OPENR,unit,'c:\idl\data\dark\date.tmz',/GET_LUN filestat=FSTAT(unit) n=filestat.size/8 julsec=DBLARR(n) READU,unit,julsec CLOSE,unit FREE_LUN,unit camnum=STRMID(files(0),18,1) limit=[0,0,0,0,200,210,220,230,230,240,250,260,0,290,0,320,0,350,0] step=20 outfiles=STRARR(1) IF camnum EQ 0 THEN BEGIN FOR i=0,N_ELEMENTS(files)-1 DO BEGIN rdkimg,files(i),header,image kih=gethd(header) t=ROUND(kih.misc.temp.tcf.mean/10.) IF ((t GE -49) AND (t LE -31)) THEN BEGIN id=t+49 IF limit(id) NE 0 THEN BEGIN mn=mean(image) IF ((mn GE limit(id)-step) AND (mn LE limit(id))) THEN BEGIN y=kih.misc.dt.year m=FIX(kih.misc.dt.month) d=FIX(kih.misc.dt.day) s=FIX(kih.misc.tm.hour)*3600. + FIX(kih.misc.tm.minute)*60. $ + FIX(kih.misc.tm.second) js=ymds2js(y,m,d,s) dummy=WHERE(julsec EQ js,label) IF label EQ 0 THEN BEGIN julsec=[julsec,js] outfiles=[outfiles,files(i)] ENDIF ENDIF ENDIF ENDIF ENDFOR ENDIF IF N_ELEMENTS(outfiles) GT 1 THEN BEGIN outfiles=outfiles(1:*) count=N_ELEMENTS(outfiles) ENDIF ELSE count=0 OPENW,unit,'c:\idl\data\dark\date.tmz',/GET_LUN WRITEU,unit,julsec CLOSE,unit FREE_LUN, unit RETURN END