PRO hetgs_gaps, offsets, MM = mm ; ; IDL procedure to calculate the location (in energy) of the ; HETGS chip gaps and create a TeX table of the same. ; ; Usage ; ----- ; Call at the IDL command line with optional list of offsets (in arc ; minutes by default or in mm if /MM is added to call.) ; ; IDL> hetgs_gaps ; or ; IDL> hetgs_gaps, [-1.2, -1.0, -0.8] ; or ; IDL> hetgs_gaps, [-3.3, -3.1, -2.9, -2.7], /MM ; ; Revision history ; --------------- ; 9/9/97 dd Written for Fred Seward for PG ; ; ...................................... ; Parameters used by the program ; Default offset values in arc minutes, + is towards center of S3. default_offsets = [-1.0, -0.66, -0.33, 0.0, 0.33, 0.66, 1.0] ; ACIS ; everybody knows this: chip_size = 1024.0 * 0.024 ; mm ; From ICD diagram: gap_size = 0.43 ; mm ; From diagram in ICD nom_offset = 6.04 ; mm from S3 edge ; HETG ; values from HETG CIP file HETGperiod.rdb heg_p = 2000.81 ; A heg_ang = -5.19 ; degrees meg_p = 4001.41 ; A meg_ang = 4.74 ; degrees ; include LEG values as well leg_p = 9912.16 ; A leg_ang = 1.0/60.0 ; degrees ; Flight Rowland spacing ; nominal design value rc_spacing = 8633.69 ; mm ; HRMA ; from TRW XC05 focal_len = 10065.5 ; mm ; hc hc = 12.3985 ; ...................................... ; screen output... print, ' ' print, ' hetgs_gaps output' print, ' ' ; Have offsets available in arc min and mm ; ; Default offsets if not specified: if n_elements(offsets) EQ 0 then begin ; in arc minutes: offsets = default_offsets end if KEYWORD_SET(MM) then begin ; offsets are in mm, calculate arc minutes offs_mm = offsets offs_arcmin = 60.*(offsets/focal_len)/!DTOR end else begin ; offsets are in arc minutes, calculate mm offs_arcmin = offsets offs_mm = focal_len*!DTOR*(offsets/60.0) end ; Open a file for the TeX output tables OPENW, hetg_unit, 'hetgs_gaps.tex', /GET_LUN ; Hey, you know they're gonna want this: OPENW, letg_unit, 'letgs_gaps.tex', /GET_LUN printf, hetg_unit, "\documentstyle{article}" printf, hetg_unit, "\begin{document}" printf, hetg_unit, "HETGS gaps table ..." ; printf, hetg_unit, "\begin{table} [h] % here, top, bottom, page_of_floats" printf, hetg_unit, "\begin{center}" printf, hetg_unit, "\begin{tabular}{|c|c|c||c|c|c|c|c|c|c|}" printf, hetg_unit, "\hline" printf, hetg_unit, "\multicolumn{2}{|c|}{Offset} & Grating & \multicolumn{7}{|c|}{HETGS Gaps (keV)} \\" printf, hetg_unit, "\hline" printf, hetg_unit, "\rule{0pt}{2.5ex} arc min. & mm & & S0 & S0-S1 & S1-S2 &" +$ "S2-S3 & S3-S4 & S4-S5 & S5 \\[0.2ex]" printf, hetg_unit, "\hline" ; LETG stuff... printf, letg_unit, "\documentstyle{article}" printf, letg_unit, "\begin{document}" printf, letg_unit, "LETG-ACIS-S gaps table ..." ; printf, letg_unit, "\begin{table} [h] % here, top, bottom, page_of_floats" printf, letg_unit, "\begin{center}" printf, letg_unit, "\begin{tabular}{|c|c|c||c|c|c|c|c|c|c|}" printf, letg_unit, "\hline" printf, letg_unit, "\multicolumn{2}{|c|}{Offset} & Grating & \multicolumn{7}{|c|}{LETG-ACIS-S Gaps (keV)} \\" printf, letg_unit, "\hline" printf, letg_unit, "\rule{0pt}{2.5ex} arc min. & mm & & S0 & S0-S1 & S1-S2 &" +$ "S2-S3 & S3-S4 & S4-S5 & S5 \\[0.2ex]" printf, letg_unit, "\hline" ; Loop over the offsets for io = 0, n_elements(offs_mm)-1 do begin print, 'Calculating edges for offset of ' + $ STRING(offs_arcmin(io),FORMAT='(F8.2)') + ' arc min.' + $ STRING(offs_mm(io),FORMAT='(F8.2)') + ' mm' ; Arrays for the chip edges w.r.t. zero-order in mm low_edge = ([0.,1.,2.,3.,4.,5.]-3.0) * (chip_size + gap_size) - $ (nom_offset + offs_mm(io)) high_edge = chip_size + low_edge print, 'Chip edges (mm):' print, low_edge print, ' ', high_edge print, '' ; Make a list of gaps gap_low = [-1.E6, high_edge] gap_high = [low_edge, 1.E6] print, 'Chip gaps (mm):' print, gap_low print, gap_high print, '' ; Convert these to Energy for meg and heg ; energy = hc / ( period * dispersion_distance/rc_spacing ) ; and dispersion_distance = gap_distance/COS(dispersion_angle) ; emeg_low = hc/( meg_p * (ABS(gap_low)/COS(!DTOR*meg_ang))/rc_spacing ) emeg_high = hc/( meg_p * (ABS(gap_high)/COS(!DTOR*meg_ang))/rc_spacing ) print, 'MEG gaps (keV):' print, emeg_low print, emeg_high print, '' eheg_low = hc/( heg_p * (ABS(gap_low)/COS(!DTOR*heg_ang))/rc_spacing ) eheg_high = hc/( heg_p * (ABS(gap_high)/COS(!DTOR*heg_ang))/rc_spacing ) print, 'HEG gaps (keV):' print, eheg_low print, eheg_high print, '' ; and LETG... eleg_low = hc/( leg_p * (ABS(gap_low)/COS(!DTOR*leg_ang))/rc_spacing ) eleg_high = hc/( leg_p * (ABS(gap_high)/COS(!DTOR*leg_ang))/rc_spacing ) ; TeX output for this offset e_fmt = '(F7.3)' printf, hetg_unit, STRING(offs_arcmin(io),FORMAT='(F6.2)') + "&" + $ STRING(offs_mm(io),FORMAT='(F6.2)') + "&" + $ " MEG &" + $ " & " + $ STRING(emeg_low(1),FORMAT=e_fmt) + " & " + $ STRING(emeg_low(2),FORMAT=e_fmt) + " & " + $ STRING(emeg_low(3),FORMAT=e_fmt) + " & " + $ STRING(emeg_low(4),FORMAT=e_fmt) + " & " + $ STRING(emeg_low(5),FORMAT=e_fmt) + " & " + $ STRING(emeg_low(6),FORMAT=e_fmt) + " \\" printf, hetg_unit, " & & &" + $ STRING(emeg_high(0),FORMAT=e_fmt) + " & " + $ STRING(emeg_high(1),FORMAT=e_fmt) + " & " + $ STRING(emeg_high(2),FORMAT=e_fmt) + " & " + $ STRING(emeg_high(3),FORMAT=e_fmt) + " & " + $ STRING(emeg_high(4),FORMAT=e_fmt) + " & " + $ STRING(emeg_high(5),FORMAT=e_fmt) + " & " + $ " \\" printf, hetg_unit, " & " + $ " & " + $ " HEG &" + $ " & " + $ STRING(eheg_low(1),FORMAT=e_fmt) + " & " + $ STRING(eheg_low(2),FORMAT=e_fmt) + " & " + $ STRING(eheg_low(3),FORMAT=e_fmt) + " & " + $ STRING(eheg_low(4),FORMAT=e_fmt) + " & " + $ STRING(eheg_low(5),FORMAT=e_fmt) + " & " + $ STRING(eheg_low(6),FORMAT=e_fmt) + " \\" printf, hetg_unit, " & & &" + $ STRING(eheg_high(0),FORMAT=e_fmt) + " & " + $ STRING(eheg_high(1),FORMAT=e_fmt) + " & " + $ STRING(eheg_high(2),FORMAT=e_fmt) + " & " + $ STRING(eheg_high(3),FORMAT=e_fmt) + " & " + $ STRING(eheg_high(4),FORMAT=e_fmt) + " & " + $ STRING(eheg_high(5),FORMAT=e_fmt) + " & " + $ " \\" printf, hetg_unit, "\hline" printf, letg_unit, STRING(offs_arcmin(io),FORMAT='(F6.2)') + "&" + $ STRING(offs_mm(io),FORMAT='(F6.2)') + "&" + $ " LEG &" + $ " & " + $ STRING(eleg_low(1),FORMAT=e_fmt) + " & " + $ STRING(eleg_low(2),FORMAT=e_fmt) + " & " + $ STRING(eleg_low(3),FORMAT=e_fmt) + " & " + $ STRING(eleg_low(4),FORMAT=e_fmt) + " & " + $ STRING(eleg_low(5),FORMAT=e_fmt) + " & " + $ STRING(eleg_low(6),FORMAT=e_fmt) + " \\" printf, letg_unit, " & & &" + $ STRING(eleg_high(0),FORMAT=e_fmt) + " & " + $ STRING(eleg_high(1),FORMAT=e_fmt) + " & " + $ STRING(eleg_high(2),FORMAT=e_fmt) + " & " + $ STRING(eleg_high(3),FORMAT=e_fmt) + " & " + $ STRING(eleg_high(4),FORMAT=e_fmt) + " & " + $ STRING(eleg_high(5),FORMAT=e_fmt) + " & " + $ " \\" printf, letg_unit, "\hline" end ; end of offset loop, io printf, hetg_unit, "\end{tabular}" printf, hetg_unit, "\caption{Table of HETGS Gap Locations}" printf, hetg_unit, "\end{center}" printf, hetg_unit, "\end{table}" printf, hetg_unit, "" printf, hetg_unit, "\end{document}" ; close the tex file close, hetg_unit free_lun, hetg_unit printf, letg_unit, "\end{tabular}" printf, letg_unit, "\caption{Table of LETG-ACIS-S Gap Locations}" printf, letg_unit, "\end{center}" printf, letg_unit, "\end{table}" printf, letg_unit, "" printf, letg_unit, "\end{document}" ; close the tex file close, letg_unit free_lun, letg_unit RETURN END