Simulations as a tool

Links:

Simulating RHESSI Images

RHESSI Simulation Control Parameters

Using Eventlist Files

Part II, Thermal-Nonthermal Simulation Example

Sample Simulated Spectrum Test


Point Sources

For a sample time, we'll use the flare of 4-jul-2002 06:20 UT

Qlook Image Plot 3 - 6 keV

Qlook Image Plot 6 - 12 keV

Qlook Image Plot 12 - 25 keV

Qlook Image Plot 25 - 50 keV


Sample sim script
hsi_switch, /sim                           ;sim eventlist - true aspect
o = hsi_eventlist(sim_ut_ref='4-jul-2002 06:22:36')
model = {gaussian_source_str}              ;Input to hsi_modulate_point_source
model.amplitude = 1.0
model.xysigma = [0.0001, 0.0001]
model.xypos = [0.0, 0.0]
spp = [1.35, 2.68, 13.72, 4.21]            ;Nonthermal part of ospex fit
o -> set, sim_spec_pars = spp              ;spectral parameters
o -> set, sim_spec_model = 'f_bpow'        ;broken power law (the default)
o -> set, /sim_use_spectrum                ;Use the spectral pars input
o -> set, sim_background = 0               ;No background (the default)
o -> set, sim_xyoffset = [825.0, -325.0]   ;position of 25-50 keV source
o -> set, sim_model = model
o -> set, sim_energy_band = [20.0, 25.0]
o -> set, /sim_diagonal_srm                ;Use diagonal energy response
Get the data, and write it out
ev = o -> getdata(sim_time_range = [0.0, 24.0])

o -> Write, 'hsi_point_source_0.fits', time_range=[0, 0], energy_band=[0, 0]
The [0, 0]'s insure that all of the simulated photons end up in the file

Do the image:

hsi_switch, /flight     ;
img_obj = hsi_image(ev_filename = 'hsi_point_source_0.fits')
image = img_obj -> getdata(xyoffset = [825.0, -325.0], $
                           energy_band = [20.0, 25.0], $
                           det_index_mask = [1, 0, 1, 1, 1, 1, 0, 0, 0], $
                           time_range = [0.0, 24.0], $
                           pixel_size = [0.25, 0.25])

img_obj -> set, image_alg = 'clean'
img_obj -> set_no_screen_output
image1 = img_obj -> getdata()


Stats for 50% contour ( See the contour )

 Box          Flux      Area   Centroid (X,Y)       Peak (X,Y)    St Dev (X,Y)          Peak
   0        17.827      9.75   824.88 -325.12   825.03 -324.98    0.79    0.81        2.7758


FWHM about 3 arcsec.


Ok, add some background..

o -> set, sim_background = 10               ;background = 10*HESSI_BACKGROUND
This is a relatively high background, but S/N is approximately 35 to 1. Results are about the same.
What about higher energy?
o = hsi_eventlist(sim_ut_ref='4-jul-2002 06:22:36')
model = {gaussian_source_str}
model.amplitude = 1.0
model.xysigma = [0.0001, 0.0001]
model.xypos = [0.0, 0.0]
spp = [10.0, 3.0, 400.0, 2.0]
o -> set, sim_spec_pars = spp
o -> set, sim_spec_model = 'f_bpow'
o -> set, /sim_use_spectrum
o -> set, sim_background = 0
o -> set, sim_xyoffset = [825.0, -325.0]
o -> set, sim_model = model
o -> set, sim_energy_band = [100.0, 300.0]
o -> set, /sim_diagonal_srm
o -> set, sim_a2d_index_mask = [bytarr(9)+1]
ev = o -> getdata(sim_time_range = [0.0, 24.0])
o -> Write, 'hsi_point_source_1.fits', time_range=[0, 0], energy_band=[0, 0]
Do the image
hsi_switch, /flight
img_obj = hsi_image(ev_filename = 'hsi_point_source_1.fits')
img_obj -> set, image_alg = 'clean'
img_obj -> set_no_screen_output
image = img_obj -> getdata(xyoffset = [825.0, -325.0], $
                           energy_band = [100.0, 300.0], $
                           det_index_mask = [0, 1, 1, 1, 1, 1, 0, 0, 0], $
                           time_range = [0.0, 24.0], $
                           pixel_size = [1.0, 1.0])


Stats for 50% contour ( See the contour )

 Box          Flux      Area   Centroid (X,Y)       Peak (X,Y)    St Dev (X,Y)          Peak
   0        35.657     40.00   824.52 -325.28   825.04 -324.93    1.52    1.71        1.5016


FWHM about 6 arcsec.

image2 = img_obj -> getdata(det_index_mask = [1, 1, 1, 1, 1, 1, 1, 1, 1])

Gives noise...



Add background, here S/N is approximately 10 to 1.

o -> set, sim_background = 10

Not much changes


Dynamic Range Test

hsi_switch, /sim
o = hsi_eventlist(sim_ut_ref='4-jul-2002 06:22:36')
model = {gaussian_source_str}
model.amplitude = 1.0
model.xysigma = [0.0001, 0.0001]
model.xypos = [1.0, -2.0]
model = [model, model]
model[1].xypos = [-1.0, 2.0]
model[1].amplitude = 0.1
spp = [1.35, 2.68, 13.72, 4.21]
o -> set, sim_spec_pars = spp
o -> set, sim_spec_model = 'f_bpow'
o -> set, /sim_use_spectrum
o -> set, sim_background = 0
o -> set, sim_xyoffset = [825.0, -325.0]
o -> set, sim_model = model
o -> set, sim_energy_band = [20.0, 25.0]
o -> set, /sim_diagonal_srm
ev = o -> getdata(sim_time_range = [0.0, 24.0])
o -> Write, 'hsi_point_source_3.fits', time_range=[0, 0], energy_band=[0, 0]

hsi_switch, /flight
img_obj = hsi_image(ev_filename = 'hsi_point_source_3.fits')
img_obj -> set, image_alg = 'clean'
img_obj -> set_no_screen_output
image = img_obj -> getdata(xyoffset = [825.0, -325.0], $
                           energy_band = [20.0, 25.0], $
                           det_index_mask = [1, 0, 1, 1, 1, 1, 0, 0, 0], $
                           time_range = [0.0, 24.0], $
                           pixel_size = [0.25, 0.25])



2 arcsec boxes ( See the boxes )

 Box          Flux      Area   Centroid (X,Y)       Peak (X,Y)    St Dev (X,Y)          Peak
   0        19.695     14.25   825.86 -327.09   825.97 -326.97    1.03    0.98        2.4874
   1        2.4763     14.25   824.00 -323.74   826.00 -324.17    1.03    0.94       0.46693

Add noise, as before (S/N is 35 to 1)



2 arcsec boxes ( See the boxes ) Box Flux Area Centroid (X,Y) Peak (X,Y) St Dev (X,Y) Peak 0 19.319 14.25 825.85 -327.13 825.94 -327.05 0.97 0.96 2.4413 1 2.0226 14.25 824.56 -323.47 826.18 -324.28 0.61 1.09 0.44604 2 1.0682 14.25 829.03 -323.25 829.88 -323.11 0.00 0.52 0.24671 3 0.72948 14.25 822.07 -326.67 821.30 -326.04 0.00 1.14 0.18022


Long Source

hsi_switch, /sim
o = hsi_eventlist(sim_ut_ref='4-jul-2002 06:22:36')
model = {gaussian_source_str}
model.amplitude = 1.0
model.xysigma = [0.0001, 10.0]
model.xypos = [0.0, 0.0]
model.tilt_angle_deg = 30.0
spp = [1.35, 2.68, 13.72, 4.21]
o -> set, sim_spec_pars = spp
o -> set, sim_spec_model = 'f_bpow'
o -> set, /sim_use_spectrum
o -> set, sim_background = 0
o -> set, sim_xyoffset = [825.0, -325.0]
o -> set, sim_model = model
o -> set, sim_energy_band = [20.0, 25.0]
o -> set, /sim_diagonal_srm
ev = o -> getdata(sim_time_range = [0.0, 24.0])
o -> Write, 'hsi_long_source_1.fits', time_range=[0, 0], energy_band=[0, 0]

Here is what the source should look like:



hsi_switch, /flight
img_obj = hsi_image(ev_filename = 'hsi_long_source_1.fits')
img_obj -> set, image_alg = 'clean'
img_obj -> set_no_screen_output
image = img_obj -> getdata(xyoffset = [825.0, -325.0], $
                           energy_band = [20.0, 25.0], $
                           det_index_mask = [1, 0, 1, 1, 1, 1, 0, 0, 0], $
                           time_range = [0.0, 24.0], $
                           pixel_size = [1.0, 1.0])



Not so great, increase photon flux by 10.



What if there are 2 long sources?

model.amplitude = 1.0
model.xysigma = [0.0001, 10.0]
model.xypos = [0.0, 15.0]
model.tilt_angle_deg = 30.0
model = [model, model]
model[1].xypos = [-15.0, 0.0]


Not so good, maybe Pixons will help



Part II, Thermal-Nonthermal Simulation Example

Comments to: jimm@ssl.berkeley.edu

21-Oct-2004, jmm