pro go_dsn_final, week, outfil=outfil ;+ ; NAME: GO_DSN_FINAL ; PURPOSE: to produce output text file showing weekly summary ; of DSN station-by-station coverage (incl. KSC) ; CALLING SEQUENCE: go_dsn_final,indgen(9)+5 ; This will create a file ~/dsn_summary.txt, showing the ; summary of DSN downlinks by station for weeks 5-13 ; INPUT: week (can be a vector) ; OPTIONAL INPUT: outfile ; METHOD: apply rd_tfile on solass* and visible files ; HISTORY: NVN written 25-may-00 ; 11-jun-00, debugged (HSH) to trap errors resulting from no SOLASS ; 3-jul-00, replaced Santiago printout with NASA total (HSH) ; 13-Oct-00, Add Santiago back in (BNH) ; 14-Oct-00, Re-organize output with Santiago (NVN) ;- extpr=anytim2ex(!stime) if extpr(6) lt 1900 then extpr(6)=extpr(6)+1900 ; for inconsistent ext time yymmdd=string(extpr(6),format='(i4.4)')+ $ string(extpr(5),format='(i2.2)')+string(extpr(4),format='(i2.2)') if n_elements(outfil) ne 1 then outfil='~/dsn_summary_'+yymmdd+'.txt' dum0='Week' dum1='Wallops' dum2='Santiago' dum3='Goldstone' dum4='Canberra' dum5='Madrid' dum6='NASA' dum7='Japan' nw=n_elements(week) openw,1,outfil printf,1,dum0,dum1,dum2,dum3,dum4,dum5,dum6, dum7, format='(a,1x,7(1x,a))' ; format='(a,4x,a,2x,a,2x,a,3x,a,3x,a,5x,a,5x,a)' ;dsn_final,16,wallops=wallops ; removed 10-Jun-00 (HSH) for i=0,nw-1 do begin dsn_final,week(i),wallops=wallops,santiago=santiago,$ goldstone=goldstone,canberra=canberra,madrid=madrid if wallops eq 0 then goto, bail ; patch (HSH) cmd="ls -t "+'$DIR_GEN_STATUS/v*_*'+string(week(i),format='(i2.2)')+'*' spawn,cmd,files & vfil=files(0) ; newest one rv=rd_tfile(vfil,11) ksc=where(strmid(rv(10,*),0,3) eq 'Vis' $ or strmid(rv(9,*),0,3) eq 'Vis', nksc) nasa = wallops+goldstone+madrid+canberra+santiago printf,1,week(i),wallops,santiago,goldstone,canberra,madrid,nasa,nksc, $ format='(2x,i2.2,7x,i2,7x,i2,8x,i2,7x,i2,5x,i2,3x,i2,4x,i2)' endfor bail: close,1 return end