SAS home  

  SAS Watchout items  

  List of SAS threads  

Spectral analysis of PN point-like sources with xmmselect and the SAS GUI

This thread contains a step-by-step recipe to extract PN spectra of a point-like source observed in Imaging mode and to create the associated response matrices, starting from a calibrated, concatenated event list (either produced with epproc or available as PPS product; here it bears the file name PN.evt). The content of this thread is the same as the thread to extract pn spectra for point-like sources (command-line version). Here, however, the extraction of scientific products is being done using the SAS task xmmselect. This is a user-friendly, graphical interface to the SAS extractor (evselect), which allows you to create a wide range of scientific products (images and pseudo-images, time series, spectra, histograms), and screen the data prior to any product accumulations. xmmselect takes advantage of the full integration between SAS and plotting tools such as grace and ds9, to define data selection regions on a 1-D (light curve) or 2-D (image) plane.

  1. set up your SAS environment (following the SAS start-up thread)

  2. start xmmselect
    xmmselect table=PN.evt &
    First a window pops-up, asking if you wish to visualize the "[...] selection expression [...]" corresponding to "[...] data subspace information [...]". In practise, xmmselect is asking you if you wish to see the data screening expression, which was employed to generate the event list. The answer to this question does not affect the following steps.

    The xmmselect call pops-up a window as shown in Fig.1.


    Fig.1: The main xmmselect window
     

    In this window, we identify:

  3. extract a single event (i.e. pattern zero only), high energy (E > 10 and < 12 keV) light curve, to identify intervals of flaring particle background. Note that in case of the PN, an upper energy limit has been introduced to avoid noisy pixels with E > 12 keV.
  4. This is done by:

    This will pop-up another window: the evselect parameter user interface (see Fig.2).


    Fig.2: The main evselect window
     

    On this multi-panel window, one should at least:


    Fig.3: The Lightcurve panel in the evselect window
     

    As customary for SAS task, each widget, button or menu in the evselect window corresponds to a task parameter. The whole list of available evselect parameters, with their description, is available at the evselect task description.

    Once Run is clicked, dsplot is silently run on the created light curve, and the corresponding grace window appears (see Fig.4)

  5. define a "low-background" interval on the light curve, using the following steps in the grace window:


    Fig.4: A grace window, displaying a light curve, and one interval created as explained in text
     

    Be aware that grace allows you to define several different types of intervals. Among the normally most useful: Above/Below line, in Vert. Range, Out of Horiz/Vert. Range, Left/Right of line

    When you are happy with your definition, click the button 1D region in the xmmselect window. The selection region will be automatically transferred into the data selection widget of the xmmselect window, and properly translated into a selectlib expression

  6. extract an image (sky coordinates in this example; extraction in detector - DET[XY] - coordinates is possible as well, and may be preferable for some specific scientific needs).
  7. This is accomplished by:


    Fig.5: The Image panel in the evselect window
     

    xmmselect will automatically launch a ds9 window on the created image

  8. select the region, from which the spectrum shall be accumulated, using the Regions/Shape/Circle in ds9 (see Fig.6)

  9. Fig.6: ds9 main window. A circular region (green circle) has been defined using the highlighted menu.
     

  10. propagate the selected region into the xmmselect data screening panel, by clicking the 2D region button

  11. extract a source spectrum, using all the selection expressions defined so far, and restricting the patterns to single and doubles:

  12. Fig.7: The Spectrum panel in the evselect window
     

  13. extract a background spectrum using the same steps 6. to 8. above. Have a look at the "EPIC status of calibration and data analysis" document (XMM-SOC-CAL-TN-0018) for latest recommendations on how to select source and background regions. In the following, we assume that the background is extracted from a source-free region at the same distance to the readout node (RAWY position) as the source region. So if your source is at line 150 on CCD 4, you should aim to select background from around line 150 on a neighbouring CCD to ensure similar low-energy noise.
  14. If you are interested in learning how to extract the background spectra from blank fields event lists, please click here.

  15. If you want to correct the source spectrum for Out-of-Time events, consult the Removing Out-of-Time events thread.

  16. generate a redistribution matrix
  17. Currently there are two possible approaches:

    a) use the SAS task rmfgen to create a redistribution matrix for your previously extracted spectrum:

    NOTE: This can take long (>30 min) on low performance computers...


    Fig.8: The rmfgen launch GUI interface
     

    b) use the ready-made (canned) matrices available at the following URL: http://xmm.esac.esa.int/external/xmm_sw_cal/calib/epic_files.shtml

  18. generate an ancillary file (for extended sources use extendedsource=yes detmaptype=flat or dataset)

  19. NOTE: arfgen reads in the pattern range from the DSS information in the spectrum dataset, and accumulates the quantum efficiency curves over those patterns, which is then combined to the other constituents of the ARF. Be aware that the entire range of allowed patterns are assumed if no pattern range is found in the DSS.


    Fig.9: The arfgen launch GUI interface
     

  20. prepare the spectrum and link associated files
  21. FTOOL: grppha: PHA filename: PNsource_spectrum.fits
                   output filename: PNsource_spectrum.grp
                   chkey BACKFILE PNbackground_spectrum.fits
                   chkey RESPFILE PN.rmf
                   chkey ANCRFILE PN.arf
                   group min 25 ! as an example
                   exit
  22. fit the spectrum

  23. NOTE ON PATTERN SELECTION IN PN SPECTRA:

  24. For bright sources and sources with narrow lines it might be better to extract two spectra and corresponding backgrounds, response and ancillary files: one set for single pixel events (PATTERN==0) and another set for doubles (PATTERN IN [1:4]).
    Fitting these two spectra simultaneously will show if there are any problems with pile-up (see also SAS thread on "How to evaluate the pile-up fraction") and - as the energy calibration for singles is slightly better than the one for doubles - will show the line features at highest energy resolution in the single events spectra.
    However, in case of PN Timing mode observations (where the rate of single to double events depends on the source position) one should always create and fit a spectrum of the combined single and double events. For details on the spectral analysis of data obtained in Timing and Burst mode, see again XMM-SOC-CAL-TN-0018.