next up previous contents
Next: Spectral Extraction using spimodfit Up: Cookbook Previous: Spectral extraction of variable   Contents

Broad band spectrum using spiros

SPI data in the 400 2200 keV energy range (  keV until revolution 1170, May 2012) show spectral artifacts caused by high-energy particles which saturate the main electronic chain (called Analogue Front-End Electronics, AFEE) and generate false triggers. However, a fraction of the signals produced by the photons interacting with the detectors are sent to a second electronic chain, the Pulse Shape Discriminator (PSD), independent from the main one. These events are not affected by the saturation problem that generates false triggers in AFEE.

Here is important to recall that the single events analysed by AFEE are labeled as SE, while those analysed by PSD are labeled as PE[*]. Since the fraction of PE events is significantly lower than SE events in the range  keV, the user aiming at studying the X-ray emission of sources over a broad energy range have to create two spectra:

  1. ``SE+PE spectrum'', based on SE and PE events, in the energy ranges keV and MeV ( keV and MeV for observations taken before May 2012);
  2. ``PE spectrum'', based on PE events, in the energy range keV ( keV for observations taken before May 2012).
Once the spectra are created, they can be fitted with xspec. In order to simplify the procedures that the user should follow during the spectral analysis stage, a script ( can be used to automatically stick together SE+PE and PE spectra. The script is publicly available at:

The PSD electronics sub-system has an efficiency of % on its energy domain because of a relatively high dead time. automatically corrects the fluxes and uncertainties in the energy range keV (or keV for observations before 2012 May) with the efficiency factor .

Hereafteer, an illustrative example of the data analyisis method to be used is shown. It is based on the same (cleaned) data set of Sect. [*].

First, you have to create the ``SE+PE'' spectrum in the range 20 2200 keV. Launch spi_science_analysis, click on ``Energy definition'' button; then, in the new window set ``Regions energy boundaries'' 20,2200 and ``Number of bins'' -35.

Since the ``SE+PE'' option in the ``Histogram options'' window is selected by default (Fig. [*]), a ``SE+PE'' spectrum will be created. For the other options, follow the method described in Sect. [*]. Click on ``Ok'' and then on ``Run'' button.

Figure: ``Histogram options'' window with ``SE+PE'' option selected by default
Image sepe

Then, you can create the response file, update the keywords in the header of spectrum_Ginga_2023.fits (see Sect. [*]), and rename the file:

mv spectrum_Ginga_2023.fits spectrum_Ginga_2023_SEPE.fits

To create the PE spectrum, launch again spi_science_analysis, click on ``Histogram options" button and un-select ``SE+PE'' option (Fig. [*]). Click ``Ok'' to close the ``Histogram options'' window.

Figure: ``Histogram options'' window with ``SE+PE'' option un-selected.
Image pe

Note that the PE spectrum needs to be created from flat-fields specifically created for spectra based on PE events. They are made available in the ic/spi/cal directory with the new release of OSA (version 11). spi_science_analysis selects and uses the appropriate flat-field (``SE+PE'' or ``PE'') automatically. If you want to use another flat-field for the ``flatfield DOL'' in the panel of Fig. [*], you can choose between these flat-fields (an appropriate path is required):

In this example we suggest to leave the ``flatfield DOL'' field empty. In this way, spi_science_analysis will select spi_flpe_grp_0073.fits automatically. Click ``Run'' in the main GUI.

spi_science_analysis will create the ``PE spectrum'' spectrum_Ginga_2023.fits. You can rename it:

mv spectrum_Ginga_2023.fits spectrum_Ginga_2023_PE.fits

Then you have to create the response matrix and update the keywords of spectrum_Ginga_2023_PE.fits.

You might notice in the spi_sa*.log logfile that some errors like:

Error -210102 and NAG status ** getting a Bunch-Kaufmann matrix factorization with NAG

occur for energy bins with energy  keV. This is due to the insufficient statistics of the PE spectrum at low energies. Since the PE spectrum is relevant in the energy range  keV, these errors can be neglected.

As mentioned above, once the ``SE+PE'' and ``PE'' spectra are created, you can use the script to stick them together:

[user@machine spi_analysis]$ python
Enter the SE+PE filename: 'spectrum_Ginga_2023_SEPE.fits'
Enter the PE filename: 'spectrum_Ginga_2023_PE.fits'
Enter the spectral response filename: 'spectral_response.rmf.fits'
Enter extension number: 36 will create the file spectrum.fits. The extension 36 contains the spectrum obtained from spectrum_Ginga_2023_SEPE.fits (energy bins before  keV) and
spectrum_Ginga_2023_PE.fits (energy bins above  keV), already corrected for the PSD efficiency.

You can modify the parameters energy_th (default: 400 keV; to be set  keV for observations performed before 2012 May) and pe_eff (i.e. PSD efficiency; default: 0.85) in the script.

next up previous contents
Next: Spectral Extraction using spimodfit Up: Cookbook Previous: Spectral extraction of variable   Contents