PRO CCDSTAT,FlagNames,StatNames ; PC version, works on DB2 ;+ ; ; NAME: ; CCDSTAT ; PURPOSE: ; Extracts the CCD Flags and CCD Status from every CCD file ; and verifies that they are correct and consistent. ; CATEGORY: ; Verification Tool ; CALLING SEQUENCE: ; CCDSTAT,FlagNames,StatNames ; INPUTS: ; None ; OPTIONAL INPUT PARAMETERS: ; None ; OUTPUTS: ; post/anal_results/ccdstat ; FlagNames: Array of filenames with bad CCD flags ; StatNames: Array of filenames with bad CCD status ; OPTIONAL OUTPUT PARAMETERS: ; None ; KEYWORDS: ; None ; COMMON BLOCKS: ; disr.inc, c_header.inc, c_system.inc ; SIDE EFFECTS: ; None ; RESTRICTIONS: ; None ; EXAMPLE: ; ccdstat,flagnames,statnames ; PROCEDURE: ; Create an array of all CCD files ; Extract CCD_FLAGS and CCD_STATUS ; Find files with incorrect entries and inconsistent entries ; Print report to post/anal_results/ccdstat ; MODIFICATION HISTORY: ; Created by Laura Ellen Dafoe 14 June 1994 ; Tested by Laura Ellen Dafoe on test log: descent1 on 26 June 1994. ; Compared with line by line run using d_hcont, CFE. ; Changed F_RHEAD to d_read at line 69 ; REVISION: ; 1.0 ; ;---------------------------------------------------------------------------- ; D I S R S O F T (C) 1 9 9 4 ;----------------------------------------------------------------------------- ;- @disr.inc @c_system.inc @c_header.inc h=strarr(256) ;spawn,'find DB/Dark DB/Image DB/Strip DB/Solar DB/Visible DB/Full -type f -print',names names1 = file_search('DB2\Dark','*MMX_*',count=nnames1) names2 = file_search('DB2\Image','*MMX_*',count=nnames2) names3 = file_search('DB2\Strip','*MMX_*',count=nnames3) names4 = file_search('DB2\Solar','*MMX_*',count=nnames4) names5 = file_search('DB2\Visible','*MMX_*',count=nnames5) names6 = file_search('DB2\Full','*MMX_*',count=nnames6) names=[names1,names2,names3,names4,names5,names6] n=0 s=size(names) if s(0) ne 0 then n=s(1) if n LT 1 then goto,leave status=intarr(n) flags=strarr(n) print,SYSTIME(),' Num of files for CCD Status check = ',n print,'Working...this can take awhile...' openw,outfile,'post/anal_results/ccdstat',/get_lun printf,outfile,SYSTIME(),' Num of files for CCD Status check = ',n wait,0.1 FOR i=0,n-1 DO BEGIN file=names(i) ;f_rhead d_read,file,h,p status(i)=D_VALUE(h,H_CCD_STATUS,good,stat) flags(i)=D_VALUE(h,H_CCD_FLAGS,good,stat) ENDFOR FlagIndex=where(flags NE 1110 and flags NE -1,CountFlags) StatIndex=where(status NE 0 and status NE -1,CountStatus) if CountFlags GT 0 then begin printf,outfile,'Number of bad CCD reads, flags ',CountFlags FlagNames=names(FlagIndex)+flags(FlagIndex) printf,outfile,FlagNames endif if CountStatus GT 0 then begin printf,outfile,'Number of bad CCD reads, status ',CountStatus StatNames=names(StatIndex)+string(status(StatIndex)) printf,outfile,StatNames endif if CountFlags LE 0 and CountStatus LE 0 then printf,outfile,'No Bad CCD Reads' $ else Print,'Errors have been found...See: .\post\anal_results\ccdstat' free_lun,outfile leave: Print,'Done!' end