pro cycles,Log ; PC version works on Science_Summary_M, 13Dec04, Csee ; This program pulls the Cycle info from the Science Summary and puts it ; in a file called 'cycles.out' in the Log directory. ; The current directory is the default cd,'',current=cdir & cd,cdir if n_params() lt 1 then Log=cdir if n_params() gt 1 then begin print,'Invalid # of parameters passed to Cycles.pro' goto,exit endif else cd,Log ; close,1 openr,1,'Science_Summary_M' close,2 openw,2,'cycles.out' printf,2,"This is the Cycle information from the Science Summary for: ",cdir printf,2,"" printf,2," Seconds Mission Time Cycle Information..." printf,2,"" time = '' name = '' rest = '' space='' n=intarr(17) ;Img, NoImg, CalA, CalB, CalC, Flat, Spect, Dark, Drain, HNS, MNS, LNS, VLNS, SurfA, SurfB, SurfC, SurfD cycles=[' Img',' NoImg',' Cal_A',' Cal_B',' Cal_C',' Flat',' Spect',' Dark',' Drain',' HNS',' MNS',' LNS',' VLNS',' SurfA',' SurfB',' SurfC',' SurfD'] co2=0 line='' ; The first line contains Cycle information... again: if eof(1) then goto,exit readf,1,line if strpos(line,'Cal') ne -1 then co2=1 ;checkout 2 (HC + IFC) flag postition=strpos(line,'Cycle')>strpos(line,'Cal') if position eq -1 then begin & print,'Error in Sci. Sum' & goto,again & endif ; bad first line reads,line,time,name,rest,format='(a14, ;;readf,1,time,name,rest,format ='(a13,a8,a)' ;;if sstr(name) eq 'Cal' then co2=1 ;checkout 2 (HC + IFC) flag ;;goto, start while not eof(1) do begin readf,1 line postition=strpos(line,'Cycle')>strpos(line,'Cal') if position eq -1 then goto,next ;;readf,1,space,time,name,rest,format ='(a1,a13,a8,a)' ;;start: ;;if not(sstr(name) eq 'Cycle' or sstr(name) eq 'Cal') then goto, next for i=0,16 do if strpos(rest,cycles(i)) ne -1 then n(i)=n(i)+1 ;counts cycles hrs=float(strmid(time,0,2)) min=float(strmid(time,3,2)) sec=float(strmid(time,6,7)) seconds=3600.*hrs+60*min+sec printf,2,seconds,time,name,rest,format='(f10.4,a15,a8,a)' next: endwhile if co2 eq 1 then goto,skip Typical=[13,29,4,4,4,1,2,2,1,7,18,6,50,1,4,0,0] print,string(10b),' Cycle Number Typical* Overage' for i=0,16 do print,cycles(i),n(i),typical(i),n(i)-typical(i), format='(a,t8,3i10)' print,string(10b),' * Based on a typical CO1 as of 30 July 2003' printf,2,string(10b),' Cycle Number Typical* Overage' for i=0,16 do printf,2,cycles(i),n(i),typical(i),n(i)-typical(i), format='(a,t8,3i10)' printf,2,string(10b),' * Based on a typical CO1 as of 30 July 2003' skip: print,string(10B),"For details see 'cycles.out' in the test log." exit: close,1 close,2 end