;+ ; NAME: DIMSTAT ; ; PURPOSE: ; To calculate the mean of the mean of the dark images, and ; the mean of the variance in the dark images passed to the ; procedure AVERAGE. ; ; CATEGORY: ; ; CALLING SEQUENCE: ; DIMSTAT,C_NUMBER,MARR,VARR ; ; INPUTS: ; C_NUMBER: A one-byte integer, specifying the camera number ; for which the dark image statitics are to be ; retrieved. ; ; KEYWORD PARAMETERS: ; None. ; ; OUTPUTS: ; MARR: A FLOAT ARRAY, containing the mean of the mean ; of the dark images, indexed by CCD temperature ; ranging from -49 to -31 deg C. at unit intervals. ; ; VARR: A FLOAT ARRAY containing the mean of the variance ; in the dark images, indexed by CCD temperature ; ranging from -49 to -31 deg C. at unit intervals. ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; None. ; ; RESTRICTIONS: ; This procedure expects that the six following files ; produced by the procedure AVERAGE exist: ; c:\idl\data\dark\number.0dk ; c:\idl\data\dark\sum.0dk ; c:\idl\data\dark\sqsum.0dk ; c:\idl\data\dark\number.1dk ; c:\idl\data\dark\sum.1dk ; c:\idl\data\dark\sqsum.1dk ; ; PROCEDURE: ; Depending on whether the C_NUMBER is set to 0 or 1, one of the two ; sets of three files, c:\idl\data\dark\number.0dk, ; c:\idl\data\dark\sum.0dk and c:\idl\data\dark\sqsum.0dk or ; c:\idl\data\dark\number.1dk, c:\idl\data\dark\sum.1dk, and ; c:\idl\data\dark\sqsum.1dk, are opended for reading. In the files ; ...\sum.0(1)dk , ...\sqsum.0(1) dk and ...\number.0(1)dk , are ; the sum of images, the sum of squares of images and the number ; of images used to produce these results, at a given CCD temperature ; ranging from -49 to -31 deg C, at unit intervals, respectively. ; Using each sum image , sum of square images and number of ; images, for a given CCD temperature, the mean of the mean image ; and the mean of the variance of the images is produced and stored ; in the two arrays marr and varr, respectively. ; ; MODIFICATION HISTORY: ; Written May 1994, by T A Oliynyk ; ; June 7, 1994: The WHILE statement was added, and the CASE statement was ; shortened. ;- PRO dimstat,c_number,marr,varr WHILE ((c_number NE 0) OR (c_number NE 1)) DO BEGIN print, 'Camera number (c_number) must be either a 0 or a 1' print, FORMAT='($,"Enter new Camera number: ")' & READ,c_number ENDWHILE CASE c_number OF 0: BEGIN OPENR,aunit,'c:\idl\data\dark\number.0dk',/GET_LUN OPENR,bunit,'c:\idl\data\dark\sum.0dk',/GET_LUN OPENR,cunit,'c:\idl\data\dark\sqsum.0dk',/GET_LUN END 1: BEGIN OPENR,aunit,'c:\idl\data\dark\number.1dk',/GET_LUN OPENR,bunit,'c:\idl\data\dark\sum.1dk',/GET_LUN OPENR,cunit,'c:\idl\data\dark\sqsum.1dk',/GET_LUN END marr=FLTARR(19) varr=FLTARR(19) n=ASSOC(aunit,LONARR(1)) sum=ASSOC(bunit,LONARR(256,256)) sqsum=ASSOC(cunit,LONARR(256,256)) FOR i=0,18 DO BEGIN m=TOTAL(n(i)) IF m GE 2 THEN BEGIN marr(i)=mean(sum(i)/m) varr(i)=mean((m*sqsum(i)-sum(i)^2)/(m*(m-1))) ENDIF ENDFOR FREE_LUN,aunit FREE_LUN,bunit FREE_LUN,cunit ENDCASE END