;+ ; ; NAME: ; CCDVerif ; PURPOSE: ; Inputs each data set in a nametable and verifies ; that the optimum exposure and the data itself are as expected ; if the file is a CCD measurement with no lamps on. ; CATEGORY: ; Verification ; CALLING SEQUENCE: ; CCDVerif,Nametable,OutFile1,OutFile2[Status] ; INPUTS: ; Nametable - list of files to be investigated ; OutputFile - file for the verification results ; OPTIONAL INPUT PARAMETERS: ; None ; OUTPUTS: ; File with any items which did not verify correctly (# 1) ; File with list of names of unverified files (lamps on, #2) ; OPTIONAL OUTPUT PARAMETERS: ; Status ; KEYWORDS: ; None ; COMMON BLOCKS: ; None ; SIDE EFFECTS: ; None ; RESTRICTIONS: ; None ; EXAMPLE: ; CCDverif,'Nametable','Outfile1','Outfile2' ; PROCEDURE: ; Loop over the files of the nametable. ; Verify the optimum exposure algorithm calculated about the right ; value ; Verify the data itself is within a noise band of what is expected ; ; MODIFICATION HISTORY: ; 29-MAY-1994 LED ; ; ;---------------------------------------------------------------------------- ; D I S R S O F T (C) 1 9 9 4 ;----------------------------------------------------------------------------- ;- PRO CCDVerif,InputFiles,OutFile1,OutFile2 @c_system.inc @c_header.inc STATUS=STRARR(4) STATUS(0)='S' STATUS(1)='SUCCESS' ; USER enter name of routine inside quotes STATUS(2)='CCD Verification' ; leave this STATUS(3)='' STATUS_SET=0 ; enter version number inside quotes VERSION='1.0' ; enter the full procedure call in here CALL='CCDVerif,Nametable,Outfile1,Outfile2,Status' ; error checking ---- insert maximum and minimum number of parameter IF (N_PARAMS(0) LT 3) OR (N_PARAMS(0) GT 4) THEN BEGIN STATUS(0)='F' STATUS(1)='FAILURE' STATUS(3)='Bad input parameters' PRINT,' ' PRINT,STRTRIM(STATUS(2),2)+' : '+STATUS(3)+'. EXIT.' PRINT,'Call is '+CALL GOTO,LEAVE ENDIF IF N_PARAMS(0) EQ 4 THEN STATUS_SET=1 ; Open the output file for data openu,out,OutFile1,/get_lun openu,out1,OutFile2,/get_lun ; Read in the baseline files. These are 0 and 0.5 msec integrations ; of the full CCD. print,'Reading in the baseline files' d_read,'/disk1/disrgse/Log/Base0',h,Base0 d_read,'/disk1/disrgse/Log/Basei',h,Basei ; Loop over InputFiles z_InputFiles=size(InputFiles) print,'Beginning the loop over the input files. Total= ',z_InputFiles(2) FOR i=0,z_InputFiles(1)-1 DO BEGIN d_read,InputFiles(i),h,p ; Make sure no lamps are on IF H_LAMP_STATE EQ 0000 THEN BEGIN Baseline=intarr(H_XSIZE,H_YSIZE) BoundsLo=intarr(H_XSIZE,H_YSIZE) BoundsHi=intarr(H_XSIZE,H_YSIZE) ; ; Determine which CCD measurement you are looking at, and calculate a ; Baseline for the pixels from the raw CCD measurements ; xstart = H_COORD_XL ystart = H_COORD_YL CASE H_MEAS_TYPE OF ; DLVS 16 : BEGIN ncol = 20 nrow = 200 numsum = ncol/H_NUM_COL ; Near Surface DLVS 15 : BEGIN ncol = 4 nrow = 200 xstart = xstart + 6 numsum = ncol/H_NUM_COL ; ULVS 17 : BEGIN ncol = 8 nrow = 200 numsum = ncol/H_NUM_COL ; Dark Current 18 : BEGIN ncol = 4 nrow = 256 numsum = ncol/H_NUM_COL ; SLI STRIP 12 : BEGIN ncol = 26 nrow = 254 xstart = H_STP_FST_COL numsum = ncol/H_NUM_COL ; Solar Aureole 14 : BEGIN ncol = 30 nrow = 50 numsum = ncol/H_NUM_COL ; DLI1 23 : BEGIN ncol = 160 nrow = 256 numsum = 1 ; DLI2 21 : BEGIN ncol = 176 nrow = 256 numsum = 1 ; SLI 22 : BEGIN ncol = 128 nrow = 256 numsum = 1 ; Upper DLI1 0 : BEGIN ncol = 160 nrow = 128 numsum = 1 ; Lower DLI1 3 : BEGIN ncol = 160 nrow = 128 numsum = 1 ; Upper DLI2 1 : BEGIN ncol = 176 nrow = 128 numsum = 1 ; Lower DLI2 4 : BEGIN ncol = 176 nrow = 128 numsum = 1 ; Upper SLI 2 : BEGIN ncol = 128 nrow = 128 numsum = 1 ; Lower SLI 5 : BEGIN ncol = 128 nrow = 128 numsum = 1 ; Full CCD 19: BEGIN ncol = 524 nrow = 256 numsum = 1 END -- Get proper data block Temp=intarr(ncol,nrow) Temp=Base0(xstart : xstart+ncol-1,$ ystart : ystart+nrow) Temp=Temp+H_EXPTIME*Basei((xstart : xstart+ncol-1,$ ystart : ystart+nrow) -- If SA data remove unused rows Temp(6:11,*)=Temp(8:13,*) Temp(12:17,*)=Temp(16:21,*) Temp(18:23,*)=Temp(24:30,*) -- sum rows if needed if (numsum NE 0) then FOR k=0,H_NUM_COL-1 DO BEGIN FOR l=k*NumSum,(k+1)*NumSum-1 DO Baseline(k,*)=Baseline(k,*)+Temp(l,*) ENDFOR endif else begin Baseline = temp endelse ; Check to see if the pixels stay in the bounds BoundsLo=0>(Baseline-fix(sqrt(Baseline*30)/30)-1) BoundsHi=(4095*NumSum)<(Baseline+fix(sqrt(Baseline*30)/30)+1) Lo=where(p LT BoundsLo) Hi=where(p GT BoundsHi) IF Lo NE -1 THEN print,out,'Low end failure ',InputFiles(i) IF Hi NE -1 THEN print,out,'High end failure ',InputFiles(i) ; Make sure optimum exposure time worked the way it should have ; What tolerance should I use? GoaldN=H_CCD_TGT_PRC*4095/100 a=where(p/NumSum GT GoaldN,count) IF count/(NumSum*H_XSIZE*H_YSIZE) GT H_CCD_PRCTILE/100.+0.05 THEN BEGIN print,out,'Over Exposed ',InputFiles(i) ENDIF IF count/(NumSum*H_XSIZE*H_YSIZE) LT H_CCD_PRCTILE/100.-0.05 THEN BEGIN print,out,'Under Exposed ',InputFiles(i) ENDIF ENDIF ; If lamps are off, do all such IF H_LAMP_STATE NE 0000 THEN print,out1,InputFiles(i) ENDFOR ; Loop over files LEAVE: free_lun,out free_lun,out1 RETURN ; END