; ; list of PR200L observations with approximate centers ; using F250W ; list = [8693,8695,8698,8700,8708,8709,8712,8716,8718,8720,8722, $ 8724,8727,8729,8731,8733,8737,8742,8744] nobs = [ 2, 2, 2, 2, 1, 2, 3, 2, 2, 2, 2, $ 3, 2, 2, 2, 2, 2, 2, 2] wave = [0, 1883.079, 1916.083, 2050.097, 0, 2144.922, $ 2246.215, 2440.797, 2487.919, 2628.815, 2734.770, $ 2930.652, 2998.845, 3219.139, 3379.250, 3521.476, $ 3909.867, 2144.922, 0] xc = [ 486, 988, 983, 967, 487, 959, 952, 941, 938, 932, 929, $ 925, 923, 918, 916, 911, 906, 962, 490]-19 yc = ((wave eq 0)*521 + (wave ne 0)*518)-20 n = n_elements(list) ; ; determine x profiles ; xprofiles = fltarr(31,n) for i=0,n-1 do begin acs_cr,indgen(nobs(i))+list(i),h,d,/disp 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',start1 dbext,list+nobs-1,'expstart,exptime',start2,integ stop2 = start2 + integ/60.0d0/60.0d0/24.0d0 time = (start1+stop2)/2.0 ;midpoint time = time-time(0) ; ; extract F250W data ; good = where(wave eq 0) wf250w = wave(good) offset = xcorr(good)-xcorr(good(0)) tf250w = time(good) ; ; correct for motion ; linterp,tf250w,offset,time,off xcorr1 = xcorr - off ; ; extract prism data ; good = where(wave gt 0) wave = wave(good) xx = xcorr1(good) xxorig = xcorr(good) list = list(good) nobs = nobs(good) ; ; convert wavelengths to air ; wave2 = double(wave)*wave fact = 1.0 + 2.735182e-4 + 131.4182/wave2 + 2.76249e8/(wave2*wave2) wave = wave/fact ; ; initial guess ; aa = [870.49113d0,1129.0314,83349.887,-858516.33,-4599354.7, $ 1.7358174d+08] ; ; 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)+860 prism_funct,sfit,aa,wfit set_plot,'ps' device,/land,file='PR200L.ps' plot,wfit,sfit,title='PR200L',xtitle='Wavelength',ytitle='Pixel', $ xrange=[1800,5000],xstyle=1,yrange=[850,1000] oplot,wave,xx,psym=4 device,/close set_plot,'x' ; ; print results ; openw,1,'PR200L.txt' printf,1,' PR200L' 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),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