Point Source Catalog¶
Though SOXS creates events from point sources as part of the background, one may want to study the point source properties in detail, and desire finer-grained control over their generation. SOXS provides the
make_point_sources_file() function for this purpose, to create a set of photons from point sources using the point-source background model and store them in a SIMPUT catalog.
First, import our modules:
import matplotlib matplotlib.rc("font", size=18) import soxs
Second, define our parameters:
exp_time = (300.0, "ks") # in seconds fov = 20.0 # in arcmin sky_center = [22.0, -27.0] # in degrees
make_point_sources_file() to create a SIMPUT catalog made up of photons from point sources. We’ll set a random seed using the
prng parameter to make sure we get the same result every time. We will also write the point source properties to an ASCII table for later analysis, using the
soxs.make_point_sources_file( "my_cat.simput", "ptsrc", exp_time, fov, sky_center, prng=24, output_sources="point_source_table.dat", overwrite=True, )
soxs : [INFO ] 2023-09-15 12:54:55,415 Appending source 'ptsrc' to my_cat.simput.
<soxs.simput.SimputCatalog at 0x128bcd6d0>
In a subsequent invocation of
make_point_sources_file(), one could use the ASCII table of sources as an input to generate events from the same sources, using the
input_sources keyword argument.
Next, use the
instrument_simulator() to simulate the observation. Since we explicitly created a SIMPUT catalog of point sources, we should turn the automatic point-source background in SOXS off by setting
soxs.instrument_simulator( "my_cat.simput", "ptsrc_cat_evt.fits", exp_time, "lynx_hdxi", sky_center, overwrite=True, ptsrc_bkgnd=False, )
soxs : [INFO ] 2023-09-15 12:54:55,607 Making observation of source in ptsrc_cat_evt.fits. soxs : [INFO ] 2023-09-15 12:54:55,902 Detecting events from source ptsrc. soxs : [INFO ] 2023-09-15 12:54:55,903 Applying energy-dependent effective area from xrs_hdxi_3x10.arf. soxs : [INFO ] 2023-09-15 12:54:57,169 Pixeling events. soxs : [INFO ] 2023-09-15 12:54:57,937 Scattering events with a image-based PSF. soxs : [INFO ] 2023-09-15 12:54:58,854 5574893 events were detected from the source. soxs : [INFO ] 2023-09-15 12:54:59,016 Scattering energies with RMF xrs_hdxi.rmf.
soxs : [INFO ] 2023-09-15 12:55:04,264 Adding background events. soxs : [INFO ] 2023-09-15 12:55:04,322 Adding in astrophysical foreground.
soxs : [INFO ] 2023-09-15 12:55:15,409 Adding in instrumental background. soxs : [INFO ] 2023-09-15 12:55:17,039 Making 51233157 events from the galactic foreground. soxs : [INFO ] 2023-09-15 12:55:17,040 Making 609517 events from the instrumental background. soxs : [INFO ] 2023-09-15 12:55:22,205 Writing events to file ptsrc_cat_evt.fits. soxs : [INFO ] 2023-09-15 12:55:43,729 Observation complete.
We can use the
write_image() function in SOXS to bin the events into an image and write them to a file, restricting the energies between 0.7 and 2.0 keV:
soxs.write_image( "ptsrc_cat_evt.fits", "ptsrc_img.fits", emin=0.7, emax=2.0, overwrite=True )
We can now show the resulting image:
fig, ax = soxs.plot_image( "ptsrc_img.fits", stretch="sqrt", cmap="plasma", width=0.1, vmin=0.0, vmax=1.0, center=[22.0, -27.0], )