;+ ; NAME: ; chip_gap_solve ; ; chip_gap_solve.pro ; ; run from IDL command line with: ; ; hak> @chip_gap_solve ; ; This script calculates the changes to the ACIS-S chips locations ; based on measurements of lines in the HEG and MEG spectra; ; e.g., in Capella and HR 1099 calibration observations. ; ; NOTE: zeroth-order offset will show up as an S2-S3 ; gap contribution !!! ; ; ---------------------------------------------------------- ;- ; - - - - - - ; 11/1/99 dd Initial version. ; LINES USED ; - - - - - - ; The rows of the matrix (below) are for these Grating/Energies: ; ; MEG 1.8, MEG 1.47, MEG 1.35, MEG 1.02, MEG 828, MEG 653 ; ; HEG 1.8, HEG 1.47, HEG 1.35, HEG 1.02, HEG 828 ; ; corresponding names with wavelengths and chips covered: meas_names = ['MEG/6.6 S2-S3', 'MEG/8.4 S2-S3', 'MEG/9.2 S2-S4', $ 'MEG/12. S2-S4', 'MEG/15. S1-S4', 'MEG/19. S1-S4', $ 'HEG/6.6 S2-S4', 'HEG/8.4 S1-S4', 'HEG/9.2 S1-S4', $ 'HEG/12. S1-S5', 'HEG/15. S0-S5'] ; DATA SET ; - - - - - ; Measured plus and minus order wavelengths: ; *** Values taken from the Fit ENERGY column !!! ; - - - ; one-line description of the data ; Use HAK analysis to reduce the zeroth-order offset... data_desc = 'Capella 2583 + ' + $ 'Level 1.5 values, 7/9/02 dd' ; Energies are pasted here from HAK output lists (in keV); ; then converted to wavelength below. minus = [1.86436, 1.47203, 1.35196, 1.02195, 0.825643, 0.653526, $ 1.86454, 1.47198, 1.35202, 1.02184, 0.825645 ] plus = [1.86505, 1.47262, 1.35240, 1.02214, 0.825870, 0.653634, $ 1.86439, 1.47208, 1.35199, 1.02176, 0.825661 ] ; - - - ; - - - - - ; convert to wavelength plus = !DDHC/plus minus = !DDHC/minus ; MATRIX ; - - - - - ; Setup a matrix which relates gap sizes to plus-minus order ; wavelength errors. In addition, an MEG-HEG zero-order offset ; in dispersion direction is included in the matrix. ; ; The MEG and HEG zero-orders may be offset from each ; other along the dispersion direction; their actual ; offsets w.r.t. the full zero-order is given by a fraction ; of the total MEG-HEG separation: ; ; |-----|----------| ; MEG Ave. HEG ; "zero" "zero" ; ; weighted by low energy HRMA area ratio: HEG=1.0, MEG=2.15 ; and 0.5 to 2. keV zero-order effic ratio: HEG=0.5, MEG=1.0 denom = 1.0*0.5 + 2.15*1.0 heg_delta_frac = 2.15*1.0/denom meg_delta_frac = 1.0*0.5/denom ; rows of the matrix: ; MEG lines (see below): r1 = [0.0, 0.0, 1.0, 0.0, 0.0, -2.0*meg_delta_frac] r2 = [0.0, 0.0, 1.0, 0.0, 0.0, -2.0*meg_delta_frac] r3 = [0.0, 0.0, 1.0, -1., 0.0, -2.0*meg_delta_frac] r4 = [0.0, 0.0, 1.0, -1., 0.0, -2.0*meg_delta_frac] r5 = [0.0, 1.0, 1.0, -1., 0.0, -2.0*meg_delta_frac] r6 = [0.0, 1.0, 1.0, -1., 0.0, -2.0*meg_delta_frac] ; HEG lines (see below): r7 = [0.0, 0.0, 1.0, -1., 0.0, 2.0*heg_delta_frac] r8 = [0.0, 1.0, 1.0, -1., 0.0, 2.0*heg_delta_frac] r9 = [0.0, 1.0, 1.0, -1., 0.0, 2.0*heg_delta_frac] r10 = [0.0, 1.0, 1.0, -1., -1., 2.0*heg_delta_frac] r11 = [1.0, 1.0, 1.0, -1., -1., 2.0*heg_delta_frac] ; the matrix a = [ [r1], $ [r2], $ [r3], $ [r4], $ [r5], $ [r6], $ [r7], $ [r8], $ [r9], $ [r10], $ [r11] ] ; PROCESSING ; - - - - print, '' print, ' chip_gap_solve output '+SYSTIME() print, '' print, ' Measured lines (Spectrum/Wavelength):' print, meas_names print, '' print, ' Data: '+data_desc print, '' print, ' Minus-side wavelengths (MEG, HEG):' print, minus print, ' Plus-side wavelengths (MEG, HEG):' print, plus print, '' ; Conversion from wavelength to pixels: mA = 89.89 hA = 179.77 pix_per_A = [mA, mA, mA, mA, mA, mA, hA, hA, hA, hA, hA] mO = -0.08 hO = 0.36 offsets = [mO, mO, mO, mO, mO, mO, hO, hO, hO, hO, hO] ; Measured plus-minus differences in pixels: b = (plus - minus) * pix_per_A print, ' Pixel differences plus - minus :' print, '' print, b print, '' print, ' - - - - - ' print, ' solve matrix equation' ; Find the solution to the matrix equation svdc, a, w,u,v sol = svsol(u,w,v, b) print, ' - - - - - ' print, ' Resulting chip gap values: ' print, sol(0:4) print, ' NOTE: 3rd value above, S2-S3 gap, includes zeroth-order determination error too.' print, '' print, ' and HEG-MEG offset value: ', sol(5), ' pixels' print, ' ( HEG, MEG offset : ', heg_delta_frac*sol(5), $ -1.0*meg_delta_frac*sol(5), ' )' print, '' ; Compare the solution results with the measured differences calc = 0.0*b for ib=0,n_elements(b)-1 do calc(ib) = TOTAL(a(*,ib)*sol) print, ' Comparing measurements and best fit values:' print, '' print, ' Plus - Minus Differences (pixels)' print, 'Spec/Wav./chips Measured Fit Difference' for ib=0,n_elements(b)-1 do print, meas_names(ib), $ ' : ', b(ib), calc(ib), STRING(b(ib)-calc(ib), FORMAT='(F11.3)') print, '' print, ' Resulting (additional) chip offsets in TDETX:' print, ' S0 : ', -1.0*TOTAL(sol(0:2)) print, ' S1 : ', -1.0*TOTAL(sol(1:2)) print, ' S2 : ', -1.0*TOTAL(sol(2)) print, ' S3 : 0' print, ' S4 : ', TOTAL(sol(3)) print, ' S5 : ', TOTAL(sol(3:4)) print, '' ; - - - end - - -