PRO CCDSTAT,FlagNames,StatNames ;+ ; ; 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. ; 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 n=size(names) status=intarr(n(1)) flags=strarr(n(1)) if n(1) LT 1 then goto,leave print,SYSTIME(),' Num of files for CCD Status check = ',n(1) openw,outfile,'post/anal_results/ccdstat',/get_lun printf,outfile,SYSTIME(),' Num of files for CCD Status check = ',n(1) FOR i=0,n(1)-1 DO BEGIN file=names(i) f_rhead 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) printf,outfile,FlagNames endif if CountStatus GT 0 then begin printf,outfile,'Number of bad CCD reads, status ',CountStatus StatNames=names(StatIndex) printf,outfile,StatNames endif if CountFlags LE 0 and CountStatus LE 0 then printf,outfile,'No Bad CCD Reads' free_lun,outfile leave: end