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 fileck=findfile('Science_Summary_M') if fileck ne '' then openr,1,'Science_Summary_M' else openr,1,'Science_Summary' 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'] cycles2=strarr(17) cycles2(0:9)=[':image','non-image','Cal Cycle A','Cal Cycle B','Cal Cycle C','Flat Field','Spectrophotometric','Dark current','Drain','High near surface'] cycles2(10:16)=['Medium near surface','Low near surface','Very low near surface','Surface A','Surface B','Surface C','Surface D'] co2=0 ; The first line is different readf,1,time,name,rest,format ='(1x,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,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,cycles2(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,'' print,'________________________________________' print,' 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: exit: print,string(10B),"For details see 'cycles.out' in the test log." close,1 close,2 spawn,'notepad '+Log+'\cycles.out' end