Research & Science Home ESA Public Web Site Sci-Tech Portal      XMM-Newton Public Web Site XMM-Newton Sci-Tech Portal
Astrophysics Missions Planetary Exploration Missions Solar Terrestrial Science Missions Fundamental Physics Missions Science Faculty

From 0 to Xspec in a few clicks


Introduction

This thread explains how to process spectral data taken with the EPIC cameras using the SAS in a quick, semi-automatic manner.

Expected Outcome

At the end of this thread a spectrum will have been created together with a background file and compatible detector matrices. These will be in a format where they may be used directly in a spectral fitting package such as XSPEC.

SAS Tasks to be Used

Prerequisites

Useful Links

Caveats



Procedure

The SAS task especget has been designed to allow extraction of a source+background and background spectra, a redistribution matrix, and an effective area vector from an EPIC event list with a single command. especget can be launched from the main xmmselect window, in which case an extraction region size optimization algorithm is also ran, which maximizes the signal-to-noise of the net source spectrum. From xmmselect the user is guided by the GUI through the especget steps. This thread illustrates how to use this functionality.

  • Set up your SAS environment (following the SAS Startup Thread)

  • Create an EPIC cleaned and filtered for particle background event file for your observation (see Prerequisites for this thread at the top of the page). Let the name of the filtered file be: EPICclean.fits.

  • Start xmmselect,

      xmmselect table=EPICclean.fits

    The xmmselect call pops-up a window similar to that shown in Fig.1.



    Fig.1: The main xmmselect window


    In this window, we identify:

    • a data screening widget (top)
    • a data column panel (middle)
    • the buttons 1D region and 2D region, which allow to translate selection expression defined in a grace or ds9 window, respectively, into proper selectlib expressions
    • "action" buttons (bottom)

  • 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). This is accomplished by:

    • click the square checkbox besides X and Y in the data column xmmselect panel
    • click on Image
    • go the the Image sub-panel in the evselect window (see Fig.2)
    • change at least the file name in the imageset window (e.g. to PNimage.fits if we are using an EPIC-pn event file)
    • click Run



    Fig.2: The Image panel in the evselect window

    xmmselect will automatically launch a ds9 window on the created image.

  • Select the region, from which the source+background spectrum shall be accumulated, using the Region/Circle menu in ds9.
    Properties should be set to Source (the green circle on the ds9 window will appear as a solid line)

  • Select the region, from which the background spectrum shall be accumulated, using the Region/Circle menu in ds9.
    Properties should be set to Background (the green circle on the ds9 window will appear as a dashed line)

  • Click the function button OGIP Spectral Products in the main xmmselect window

  • A window pops-up, asking the user for the preferred method to determine the source+background extraction region:



    Fig.3: Spectrum extraction region optimization window in especget

    • Use optimized region: allows the user to extract the source+background spectrum from a circular region, which maximizes the signal-to-noise ratio. The properties of this optimal region are displayed in the window.
    • Use initial region: allows the user to extract the source+background spectrum from the region initially chosen.
    • Start over: allows the user to start the whole process again, from the definition of spectral extraction regions in the field-of-view image.

  • A current window pops-up, asking for confirmation of the input parameters (see Fig.4).



    Fig.4: Main especget window

    The optimum pattern and event flag selections are set automatically for the detector being used (EPIC-MOS or EPIC-pn). If the expression wants to be changed, it can be done through the Main tag of the especget task.


    It is recommended to change the filestem parameter to a string of user's choice. Be reminded that xmmselect silently overwrites files with the same name. Given the choices in Fig.4, the following files will be created:

    • stem_srcspec.ds: source+background spectrum
    • stem_bckspec.ds: background spectrum
    • stem_srcspec.rmf: redistribution matrix
    • stem_srcspec.arf: effective area vector

  • Prepare the source+background spectrum and link associated files,
    FTOOL: grppha: PHA filename: mypn_src.ds
                   output filename: EPICsource_spectrum.grp
                   group min 25 ! as an example
                   exit

  • Everthing is now ready to fit the spectrum.


Last Updated: 16 April 2010



Caveats
  • NOTE ON PATTERN SELECTION IN PN SPECTRA:

    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 task epatplot) and - as the energy resolution 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 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.



   Copyright 2012© European Space Agency. All rights reserved.
This page was last updated on 1 March, 2011.