; ; list of PR130L observations with approximate centers ; first and last observation is F115LP ; list = 8800+[47,62,63,64,65,66,67,68,69,70,71,72] wave = [123,138,142,148,154,160.8,214.3,253.7,300.0,123.0]*10.0d0 xc = [500,195,256,265,274,282,288,313,320,324,196,500] yc = [523,replicate(547,10),523] n = n_elements(list) wave = wave + 0.9 ;monochromator zero point offset ; ; determine x profiles ; xprofiles = fltarr(31,n) for i=0,n-1 do begin acs_read,list(i),h,d sub = d(xc(i)-15:xc(i)+15,yc(i)-6:yc(i)+6) xprofiles(*,i) = total(sub,2) end ; ; determine x-centroids ; p = xprofiles(*,0) p = (p-max(p)*0.33)>0 xcentroid = total(p*findgen(31))/total(p) + xc(0)-15 ; compute cross correlation of spectra from first ; xcorr = fltarr(n) for i=0,n-1 do begin cross_correlate,xprofiles(*,0),xprofiles(*,i),off xcorr(i) = xcentroid + xc(i) - xc(0) - off end ; ; correct for image motion ; dbext,list,'expstart,exptime',start,integ time = start + integ/60.0d0/60.0d0/24.0d0/2.0 xcorr1 = xcorr - ((xcorr(n-1)-xcorr(0)) * $ (time-time(0))/(time(n-1)-time(0))) ; ; extract prism centers ; xxorig = xcorr(1:n-2) xx = xcorr1(1:n-2) ; ; initial guess ; aa =[354.45418,1064.0432,-16482.625,1894216.7, 56465386.,1.2366679d+09] ; ; fit without weights ; fit=curfit(xx,wave,'prism_funct',aa,indgen(6)) ; ; fit using weights computed from dispersion ; prism_funct,xx-0.01,aa,w1 prism_funct,xx+0.01,aa,w2 disp = (w2-w1)/0.02 weight = 1/disp^2 fit = curfit(xx,wave,'prism_funct',aa,indgen(6),weight) ; ; plot results ; sfit = indgen(250)+100 prism_funct,sfit,aa,wfit set_plot,'ps' device,/land,file='PR130L.ps' plot,wfit,sfit,title='PR130L',xtitle='Wavelength',ytitle='Pixel', $ xrange=[1000,3000],xstyle=1,yrange=[150,400] oplot,wave,xx,psym=4 device,/close set_plot,'x' ; ; print results ; openw,1,'PR130L.txt' printf,1,' PR130L' printf,1,' ' for i=0,5 do printf,1,'a'+strtrim(i,2)+' = ',aa(i) printf,1,'RMS of fit = ',stdev((wave-fit)/disp), ' pixels' printf,1,' Entry Xcenter Corrected Wavelength WFIT '+ $ 'Residual Residual' printf,1,' Xcenter '+ $ 'Angstroms Pixels for i=0,n_elements(wave)-1 do $ printf,1,list(i+1),xxorig(i),xx(i),wave(i),fit(i), $ wave(i)-fit(i),(wave(i)-fit(i))/disp(i), $ format='(I7,6F10.2) close,1 end