; ; list of PR110L observations with approximate centers ; first and last observation is F115LP ; list = 8800+[31,33,34,35,36,37,38,39,40,42,43,44,45,46] wave = [116,118,123,138,142,148,154,160.8,214.3,253.7,300,184.9]*10.0d0 xc = [499,168,181,201,237,244,252,257,263,285,292,297,276,499] yc = [522,replicate(539,12),522] 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-centroid of first un-dispersed observation ; 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 positions for the prism observations ; xxorig = xcorr(1:n-2) xx = xcorr1(1:n-2) ; ; Set intial guess ; aa = [339.30334d0,1051.1931,21353.219,9253454.0,4.9277635e+08, $ 1.2329024e+10] ; ; fit with no weights ; fit=curfit(xx,wave,'prism_funct',aa,indgen(6)) ; ; fit again with weights computed using 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 fit ; sfit = indgen(200)+100 prism_funct,sfit,aa,wfit set_plot,'ps' device,/land,file='PR110L.ps' plot,wfit,sfit,title='PR110L',xtitle='Wavelength',ytitle='Pixel', $ xrange=[1000,3000],xstyle=1,yrange=[100,300] oplot,wave,xx,psym=4 device,/close set_plot,'x' ; ; print results ; openw,1,'PR110L.txt' printf,1,' PR110L' 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