file: marx_ssi_sims.txt This file summarizes the use of MARX, dd's fil software, and ISIS in order to demonstrate the sub-aperture and "ssi" (separated segment images) techniques for dispersive grating spectrometers... ------------ MARX simulation(s) ---------------------- Carried out in /nfs/spectra/d2/MARX_SUBSSI Setup MARX (at MIT) by doing (one time per session): unix> source /nfs/cxc/a1/setup/marx-setup-devel marx_dist.par is the original marx.par file from the distribution. unix> cp /nfs/cxc/a1/src/marx/marx-dist-devel/marx.par marx_dist.par - - - Create a modified parameter file for the simulation, e.g., cp marx_dist.par marx_sxt.par The goal is to make the HRMA blurrier (6" HPD PSF) and to have all the gratings in the HETG be HEG gratings with same HEG period and angle (and improved efficiency by removing the poly and plating base.) So that a 6" mirror with 2000 A gratings is the same resolving power and a 15" mirror with 800 A gratings... Specifically, edit marx_sxt.par to change: - ExposureTime, OutputDir Have the OutputDir agree with the filename, e.g., "sxt". - DetIdeal to yes for better ray-trace efficiency - MinEnergy, MaxEnergy both to 0.825796 = 15.014 A Fe line - HRMA blur increased by a factor of 18 to get a 6" HPD PSF result, multiply P1Blur, H1Blur, etc by 18.0 - Set to "no" UseGratingEffFiles and Use_HETG_Sector_Files - Set to 0.0 the heg/meg Gold, Chromium and Polyimide - Change heg/meg bar height and bar width to 0.2500 and 0.1000 respectively - Change heg/meg dTheta to 0.5 - Change heg/meg dPoverP to 100.0e-6 (limits E/dE of 4200) - Change the meg Period to same as HEG value. - Change the meg Theta to same as HEG value. Verify/See what's going on in the file by doing: unix> diff marx_sxt.par marx_dist.par and save it: unix> diff marx_sxt.par marx_dist.par > diff_sxt.txt - - - Run MARX with the file as input: unix> marx @@marx_sxt.par And create the FITS output file: unix> marx2fits sxt sxt_evts.fits - - - Repeat above to make a sub-aperture simulation using the top and bottom quadrants of the mirror only - use the XRCF shutters to remove the side quadrants and double the exposure time to get the same number of total rays at output. unix> cp marx_sxt.par marx_sub.par Edit marx_sub.par to change: - double ExposureTime - set OutputDir to "sub" - New shutter configuration: Shutters1,s,a,"0101",,,"Enter mirror 1 shutter bitmap (0 == open, 1 == closed)" Shutters3,s,a,"0101",,,"Enter mirror 3 shutter bitmap (0 == open, 1 == closed)" Shutters4,s,a,"0101",,,"Enter mirror 4 shutter bitmap (0 == open, 1 == closed)" Shutters6,s,a,"0101",,,"Enter mirror 6 shutter bitmap (0 == open, 1 == closed)" unix> diff marx_sub.par marx_dist.par > diff_sub.txt unix> marx @@marx_sub.par unix> marx2fits sub sub_evts.fits OK, now we have sxt_evts.fits and sub_evts.fits to be used below... Also made ring_evts.fits which is the same as sub but with a disk model for the source, r_in, r_out = 4.8" and 6"; this is roughly the size of E0102's reverse shocked ring... Make sub15as_evts.fits which is same as sub_evts.fits except that the HRMA blurs are increased another factor of 2.68 to create a real PSF blur of 15" HPD... Also make marx_hrma.par same as sxt and sxt15as but with the nominal HRMA Blur values - to see what the values of HPD and FWHM/HPD are for the HRMA. --------------------- fil analysis in IDL --------------------- Carried out in /nfs/spectra/d2/GtoHAK/working/ IDL started using dd's hetgcal_idl_start.pro or hak_start.pro... (not all this s/w is in HAK distribution yet...) Read the fits file: ; sxt: hetgcal> fil_get_data, '/nfs/spectra/d2/MARX_SUBSSI/sxt_evts.fits', $ PREFIX='sxt' ; sub and ssi: hetgcal> fil_get_data, '/nfs/spectra/d2/MARX_SUBSSI/sub_evts.fits', $ PREFIX='sub' Or replace "sxt" with "sub" above for sub and ssi simulations... fil_reg_size = 300.0 ; to be in range... fil_zoplot ; set the zeroth-order location...(and path) ; - - - ; Process the events for streak removal and/or ssi effect ; sxt and sub : Remove the readout streak events: fil_ssi_apply, RANGE=179.9, N_SECTORS=1, SPACING=100.0 For sxt measure the PSF's HPD as given at the end of this file. ; Apply the ssi simulation effects for the "ssi" case ; Specify an angle range, number of sectors and spacing between images (pixels) ; ("opposite" sectors included too, use OPPOSITE=0 to not include them) ; ssi : This is a nice nominal set of parameters: ; creates 5 sectors of 18 degrees each... fil_ssi_apply, RANGE=90.0, N_SECTORS=5, SPACING=30.0 ; And change the fil_prefix to indicate processing: fil_prefix = 'ssi' ; For the real 15" mirror blur use large spacing value: ; ssi15as : This is a nice nominal set of parameters: ; creates 5 sectors of 18 degrees each... fil_ssi_apply, RANGE=90.0, N_SECTORS=5, SPACING=80.0 ; And change the fil_prefix to indicate processing: fil_prefix = 'ssi15as' ; ; for fun also use just the central 15 degrees: fil_ssi_apply, RANGE=15.0, N_SECTORS=1, SPACING=100.0 ; And change the fil_prefix to indicate processing: fil_prefix = 'ssi15' ; And make sure path is OK: fil_zoplot ; and the full region: fil_zofull_size = 200.0 ; Set to full width of z-o region ; - - - sxt, sub, ssi cases: ; Analyze the data with fil_extract: fil_zeroth_xy, /CALC ; Calc.s z-o location in X,Y, TDETX,Y ; Do it for the two HEG spectra only: ; sxt and sub: do not apply shearing fil_part=1 fil_order=1 fil_extract, /PS, /NOZORMFADJ, /NOSHEAR, /PREFIX_OK fil_part=1 fil_order=-1 fil_extract, /PS, /NOZORMFADJ, /NOSHEAR, /PREFIX_OK ; ssi: Do apply shearing fil_part=1 fil_order=1 fil_extract, /PS, /NOZORMFADJ, /PREFIX_OK fil_part=1 fil_order=-1 fil_extract, /PS, /NOZORMFADJ, /PREFIX_OK fil_gaps, /IGNORES ; Makes a table to point browser at: ; (e.g., file:/nfs/spectra/d2/GtoHAK/working/[sxt|sub|ssi]_table.html ) fil_html_table - - - The outputs of these fil analyses were then copied into the directory: /nfs/spectra/d2/GtoHAK/ConXsims/ and are used bu ISIS below. ------------------------- ISIS fitting ---------------- Start up isis and use dd's start.i file, e.g., for window "p1" below... ; Load, plot, and fit a Gaussian to the LRF core... delete_data(all_data); load_data("/nfs/spectra/d2/GtoHAK/ConXsims/ssi_HEGp1_isis.dat"); set_fit_statistic ("chisqr;sigma=gehrels"); window(p1); ylin; yrange(0.0,); xrange(15.014-0.1, 15.014+0.1); notice(1); plot_data_counts(1, yellow); fit_fun("gauss(1)"); set_par(1, 10000); set_par(2, 15.014); set_par(3,0.003); xnotice(1, 15.014-0.015, 15.014+0.015); fit_counts; oplot_model_counts(1,purple); list_par; - - - Results E/dE = 15.014/(2.35*sigma) : HEGp HEGm hrma 1477 1470 HEGp HEGm sxt 567 570 sub 680 667 gauss area ~ 42,000 counts cdnarrow 909 898 gauss area ~ 24,000 counts ssi 937 872 gauss area ~ 56,600 counts ssi15 1264 1256 sxt15as 456 455 sub15as 536 538 ssi15as 689 666 ssi15as15 846 852 - - - - - - - - Compare all LRFs... delete_data(all_data); load_data("/nfs/spectra/d2/GtoHAK/ConXsims/sxt_HEGm1_isis.dat"); load_data("/nfs/spectra/d2/GtoHAK/ConXsims/sub_HEGm1_isis.dat"); load_data("/nfs/spectra/d2/GtoHAK/ConXsims/ssi_HEGm1_isis.dat"); load_data("/nfs/spectra/d2/GtoHAK/ConXsims/ssi15_HEGm1_isis.dat"); % % Multiply this last one by 6 since it is only for 15 degrees... gds = get_data_counts (4); gds.value = 6.0*gds.value; gds.err = 6.0*gds.err; put_data_counts (4, gds); window(p1); % Log or linear y-axis: ylog; yrange(1.0,1.0e5); % or %%ylin; %%yrange(0.0,); xrange(15.014-0.1, 15.014+0.1); notice(all_data); plot_data_counts(4, purple); oplot_data_counts(3,yellow); oplot_data_counts(2,green); oplot_data_counts(1,orange); ------------------------------------------------------------- --------------- Other stuff -------------------------- ; - - - sxt only ; ; Measure the HPD of the simulated PSF... ; After doing fil_get_data and setting z-o location w/fil_zoplot do: ; Plot the zeroth order events: plot, fil_ax - fil_zox, fil_ay - fil_zoy, PSYM=3, xrange=[-100.0,100.0],yrange=[-100.0,100.0] ; Select the zeroth-order ones: sel = where( (ABS(fil_ax - fil_zox) LT 200.0) AND $ (ABS(fil_ay - fil_zoy) LT 200.0) ) ; How many? print, n_elements(sel) ; Assign radii to z-o events: rads = SQRT( (fil_ax(sel) - fil_zox)^2 + (fil_ay(sel) - fil_zoy)^2 ) ; sort them srads = rads(SORT(rads)) ; Plot the EE fraction of each event vs radius ; (Herman's technique): fracs = (1.0+lindgen(n_elements(srads)))/(1.0+n_elements(srads)) plot_oi, srads, fracs, TITLE='SXT: Simulated EE Curve', $ XRANGE=[0.1,100.0], xtitle='Radius (pixels)', ytitle='EE fraction' ; Find the half power radius: above = where(fracs GE 0.5) hpr = srads(MIN(above)) print, 'HPR = ', hpr, ' pixels' ;;print, 'HPD ~ ', hpr, ' arc sec' ;;print, 'HPD scaled by period ~ ', 2.5*hpr, ' arc sec' ; put it in a ps file pre_print_rect plot_oi, srads, fracs, TITLE='SXT: Simulated EE Curve', CHARSIZE=1.5, $ XRANGE=[0.1,100.0], xtitle='Radius (pixels)', ytitle='EE fraction' oplot, hpr*[1.0,1.0],[0.0,1.0],linestyle=1 oplot, hpr*[0.01,1000.0],[0.5,0.5],linestyle=1 xyouts, 0.3, 0.51, 'HPR = '+STRING(hpr,FORMAT='(F5.2)')+' pixels', SIZE=1.5 device, /close set_plot, 'X' SPAWN, 'cp idl.ps '+fil_prefix+'_ee.ps' ; - - - ; Can control the ssi more explicitly, e.g., ; FOR TESTING: Separate seven sectors "vertically" only: ; Input custom sector limits and offsets: ;;fil_ssi_apply, [-145.0, -100.0, -55.0, -10.0, 35.0, 80.0, 125.0], $ ;; [-125.0, -80.0, -35.0, 10.0, 55.0, 100.0, 145.0], $ ;; [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ ;; [ -15.0, -10.0, -5.0, 0.0, 5.0, 10.0, 15.0], $ ;; opposite=0 -------------------------------------------------------------------------