print, 'Output Medium: ' print, ' ' print, ' output.ps (0)' print, ' output.eps (1)' print, ' Tektronix-Screen (2)' print, ' X-Screen (3)' print, ' Windows (4)' print, ' terminate program (5)' read, medium case medium of 0: begin set_plot, 'PS' device, filename='output.ps', $ ; /landscape, $ ; xoffset=2.5, yoffset=26., $ ; xsize=24., ysize=16. /portrait, $ xoffset=2., yoffset=3., $ xsize=16., ysize=24. end 1: begin set_plot, 'PS' device, filename='output.eps', $ /encapsulated, $ xsize=24., ysize=16. end 2: begin set_plot, 'TEK' end 3: begin set_plot, 'X' ; window, 0, xsize=650.*210/297, ysize=650. ; !p.color=255 ; !p.background=0 end 4: begin set_plot, 'WIN' ; window, 0, xsize=600., ysize=400. ; !p.color=255 ; !p.background=0 end else: begin print, 'Program terminated' stop end endcase xyouts, 0.5, 0.5, /normal, '!5' dummy = ' ' rflag = 'y' ;print, 'read data? (y/n)' ;read, rflag print, 'Which time range ?' print, 'Enter min time (-1 for full range or time range unchanged)' ;read, mintime mintime = -1 if mintime ne -1 then begin print, 'Enter max time' read, maxtime endif else begin mintime = 0. maxtime = 0. endelse print, 'Connect data points with lines ? (y/n)' ;read, dummy dummy = 'n' if dummy eq 'n' then begin !p.psym = 3 ; keine linien sondern punkte endif else !p.psym = 0 if rflag eq 'y' then begin fname = 'fr_pw.dat' ; fname = ' ' ; read, fname, prompt = 'Enter file name: ' openr, 1, fname ln = long(0.0) while not eof(1) do begin readf, 1, dummy ln = ln + 1 endwhile close, 1 dat = dblarr(2, ln) openr, 1, fname readf, 1, dat close, 1 dat[0,*] = dat[0,*] * 60.0 ; <=> Minuten dat_smoothed = dblarr(2, ln) dat_smoothed[0,*] = dat[0,*] read, nos, prompt = 'Enter number of samples for smoothing: ' dat_smoothed[1,*] = smooth(dat[1,*], nos, /edge_truncate) ; 480 = 1 min dat_smresid = dblarr(2, ln) dat_smresid[0,*] = dat[0,*] dat_smresid[1,*] = dat[1,*] - dat_smoothed[1,*] openw, 1, 'fr_smresid.dat' for i = long(0.), ln-1 do printf, 1, format = '(d20.10, d20.10)', dat_smresid[0,i] / 60., dat_smresid[1,i] close, 1 openw, 1, 'fr_smoothed.dat' for i = long(0.), ln-1 do printf, 1, format = '(d20.10, d20.10)', dat_smoothed[0,i] / 60., dat_smoothed[1,i] close, 1 endif !p.charsize = 1.5 !p.charthick = 2.0 !p.multi = [0, 1, 3, 0, 0] plot, dat[0,*], dat[1,*], $ xtitle = '!18t - t!D0!N!X [min]', $ xrange = [mintime, maxtime], $ xstyle = 1, $ ; ytitle = ytit, $ ytitle = 'f!DR!N [Hz]', $ ; yrange = yra, $ ystyle = 3 plot, dat_smoothed[0,*], dat_smoothed[1,*], $ xtitle = '!18t - t!D0!N!X [min]', $ xrange = [mintime, maxtime], $ xstyle = 1, $ ytitle = 'f!DR!N-Smoothed [Hz] (' + string(nos) + ' samples)', $ ; yrange = yra, $ ystyle = 3 plot, dat_smresid[0,*], dat_smresid[1,*], $ xtitle = '!18t - t!D0!N!X [min]', $ xrange = [mintime, maxtime], $ xstyle = 1, $ ytitle = 'f!DR!N-Residuals (Data - smoothed data) [Hz]', $ yrange = [-20., 20.], $ ystyle = 3 if medium eq 0 then device, /close !p.psym = 0 !p.charsize = 1.0 !p.charthick = 1.0 !p.title = '' !y.range = 0 !y.style = 0 !y.title = '' !x.range = 0 end