Quick start

The main purpose of this simulation package is to simulate an observation of a given source model, based on suitable detector response functions.

xppimms

As a first test case we can evaluate the MDP for a single point source using the xppimms tool. Its capabilities and options are described in the Application reference section of the documentation.

In order to reproduce the results reported here for a standard source (power law spectrum with index 2 and normalization 10 at 1 keV, no absorption), in 100 ks and in the 2-8 keV energy range, we run the command

xppimms --duration 10000

Which prints out the following MDP table:

...
2.00--2.83 keV:      494.5 counts, effective mu = 0.209, MDP = 92.42%
2.83--4.00 keV:      236.8 counts, effective mu = 0.333, MDP = 83.67%
4.00--5.66 keV:       77.8 counts, effective mu = 0.407, MDP = 119.53%
5.66--8.00 keV:       18.2 counts, effective mu = 0.477, MDP = 211.20%
2.00--8.00 keV:      827.3 counts, effective mu = 0.269, MDP = 55.47%

This program calculates the MDP by direct numerical integration of the power-law input spectrum. As a consequence, part of the richness of the detector response (most notably, the energy dispersion and the effective area vignetting) is not captured here. For use cases beyond simple stationary point sources, the use of xpobssim and xpbin in PCUBE mode are recommended, as this approach offers the maximum flexibility (see next section for an example).

xpobssim

The main Monte Carlo simulation application is xpobssim. For a quick reference on this tool see Application reference section. Assuming that the current working directory is the ixpeobssim root folder, the command

xpobssim --configfile ixpeobssim/config/toy_point_source.py --duration 100000

Will produce three event (FITS) files (one for each Detector Unit) with a 100 ks simulation of a stationary source with a power-law spectrum (with an index of 2 and normalization of 10) with energy- and time-independent polarization degree (0.5) and angle (30°), correctly folded with all the instrument response functions: effective area, modulation factor, energy dispersion and point-spread function.

In order to bin the event files in energy (from 2 keV to 8 keV in one single bin) we run the command

xpbin $IXPEOBSSIM_DATA$/toy_point_source_du?.fits --algorithm PCUBE --emin 2. --emax 8. --ebins 1

that will produce three new FITS files (called modulation cubes), containing the MDP value (at 99%) and the histogram of the azimuthal distribution of photoelectrons emission for every bin.

The binned output files can be easily visualized using the xpbinview tool:

xpbinview $IXPEOBSSIM_DATA$/toy_point_source_du?_pcube.fits

We are already fully equipped for a basic spectral analysis with XSPEC. The first step is to bin again the event files by running the xpbin tool with the PHA1 algorithm.

xpbin $IXPEOBSSIM_DATA$/toy_point_source_du?.fits --algorithm PHA1

We can feed the binned files (along with the corresponding .arf and .rmf response functions) into XSPEC and recover the input parameters of our source.

xpxspec $IXPEOBSSIM_DATA$/toy_point_source_du?_pha1.fits