PRO thruplot,filename,w_out,t_out,nskip,title,angst ; ; plot wavelength, throughput data in FILENAME ; over range W_LIMIT. Interpolate results at ; W_OUT, and return throughputs T_OUT. ; NSKIP gives the number of header lines to ; skip in the data file. ; TITLE is the title of the plot. ; If ANGST NE 0b, the units are assumed to be ; angstroms, and wavelengths are not converted. ; If ANGST = 0b, the units are assumed to be nm ; and are converted to angstroms by multiplying ; by 10. ; ; read file, put wavelength in angstroms readcol,filename,w_dat,thru_dat,skipline=nskip IF (angst EQ 0b) THEN w_dat = 10.0 * w_dat ; ; limits of interpolation w_limit = fltarr(2) w_limit[0] = min(w_dat) w_limit[1] = max(w_dat) ; ; interpolate w_fit = w_limit[0] + indgen(fix(w_limit[1] - w_limit[0] + 1)) thru_fit = spline(w_dat,thru_dat,w_fit) t_out = spline(w_dat,thru_dat,w_out) ; ; plot plot,w_dat,thru_dat,psym=1,tit=title,yrange=[0.0,1.0],$ xtit='Wavelength (Angstroms)',ytit='Throughput',xs=3 oplot,w_fit,thru_fit oplot,w_out,t_out,psym=4 END PRO thruplot_all ; calculate throughput of all relevent filters ; and the MAMA at two different wavelengths files = ['mama_thru.dat', $ 'pmt_dqe96.dat', $ 'f122m.dat', $ 'f115lp.dat', $ 'f125lp.dat', $ 'f140lp.dat', $ 'f150lp.dat', $ 'pr110l.dat', $ 'pr130l.dat'] t1236 = fltarr(n_elements(files)) t1469 = fltarr(n_elements(files)) w_out = [1236.0, 1469.0] ; w_lim = [1216.0, 1900.0] openw,unit,'throughputs.dat',/get_lun window,/free FOR i = 0, (n_elements(files) - 1) DO BEGIN thruplot,files[i],w_out,t_out,6,files[i],0b t1236[i] = t_out[0] t1469[i] = t_out[1] print,files[i],w_out[0],t_out[0],w_out[1],t_out[1], $ format='(a20,2(2x,f6.1,2x,f6.4))' printf,unit,files[i],w_out[0],t_out[0],w_out[1],t_out[1], $ format='(a20,2(2x,f6.1,2x,f6.4))' print,'Hit any key to continue ...' junk = get_kbrd(1) ENDFOR close,unit END