skip to content
 
XMM-Newton Guest Observer Facility

THE XMM-NEWTON ABC GUIDE, STREAMLINED

EPIC-MOS (TIMING mode), SAS GUI


Contents


Prepare the Data
Reprocess the Data
Introduction to xmmselect
Apply Standard Filters
Make a Light Curve
Extract the Source and Background Spectra
Check for Pile Up
Determine the Spectrum Extraction Areas
Create the Photon Redistribution Matrix (RMF) and Ancillary File (ARF)

Prepare the Data

Please note that the two tasks in this section (cifbuild and odfingest) must be run in the ODF directory. These are the only tasks with that requirement, and after this section, we will work exclusively in our reprocessing directory.

Many SAS tasks require calibration information from the Calibration Access Layer (CAL). Relevant files are accessed from the set of Current Calibration File (CCF) data using a CCF Index File (CIF).

To make the ccf.cif file, first make sure the environment variables are set:

   cd ODF
   setenv SAS_ODF /full/path/to/ODF/directory/
   setenv SAS_ODFPATH /full/path/to/ODF/directory/

Next, call cifbuild from the SAS GUI. A window with the parameter options will appear; the defaults should be fine, so just click "Run".

To use the updated CIF file in further processing, you will need to reset the environment variable SAS_CCF:

   setenv SAS_CCF /full/path/to/ODF/ccf.cif
The task odfingest extends the Observation Data File (ODF) summary file with data extracted from the instrument housekeeping data files and the calibration database. It is only necessary to run it once on any dataset, and will cause problems if it is run a second time. If for some reason odfingest must be rerun, you must first delete the earlier file it produced. This file largely follows the standard XMM naming convention, but has SUM.SAS appended to it. After running odfingest, you will need to reset the environment variable SAS_ODF to its output file. To run odfingest and reset environment variable, call odfingest from the SAS GUI. As before, a pop-up window with the parameter options will appear; the defaults should be fine, so just click "Run". (It is safe to ignore the warnings.)

To change the environmental variable, type

   setenv SAS_ODF /full/path/to/ODF/full_name_of_*SUM.SAS
You will likely find it useful to alias these environment variable resets in your login shell (.cshrc, .bashrc, etc.).

Reprocess the Data

To reprocess the data, make a new working directory and call emproc from it:
   cd .. 
   mkdir PROC 
   cd PROC
Then, close and re-open the SAS GUI, so that it will place the output files in the new directory, and call emproc. The defaults are fine for most observations, so just click "Run". (It is safe to ignore the warnings.)

By default, the task does not keep any intermediate files it generates. Emproc designates its timing output event files with "TimingEvts.ds". It is convenient to rename the event file something easy to type:

   cp 0201_0070740101_EMOS1_S001_TimingEvts.ds mos1_te.fits

If you are likely to want to extract a background spectrum for your source, you will also need to consider the imaging event file. We might as well deal with that while we're here. Remember that whatever filtering is done on the timing event file must also be done on the image event file.

   cp 0201_0070740101_EMOS1_S001_ImagingEvts.ds mos1_ie.fits

Introduction to xmmselect

The task xmmselect is used for many procedures in the GUI. Like all tasks, it can easily be invoked by starting to type the name and pressing enter when it is highlighted.

When xmmselect is invoked a dialog box will first appear requesting a file name. You can either use the browser button or just type the file name in the entry area, "mos1_te.fits:EVENTS" in this case. To use the browser, select the file folder icon; this will bring up a second window for the file selection. Choose the desired event file, then the "EVENTS" extension in the right-hand column, and click "OK". The directory window will then disappear and you can click "Run" on the selection window.

When the file name has been submitted the xmmselect GUI will appear, along with a dialog box offering to display the selection expression; this is shown in Figure 1. The selection expression will include the filtering done to this point on the event file, which for the pipeline processing includes for the most part CCD and GTI selections.

Different event files can be loaded into xmmselect by going to "File -> New Table".

Figure 1: The xmmselect GUI.

Apply Standard Filters

The filtering expression for the MOS in TIMING mode is:

   (PATTERN <= 12)&&(PI in [200:12000])&&#XMMEA_EM

The first two expressions will select good events with PATTERN in the 0 to 12 range. The PATTERN value is similar the GRADE selection for ASCA data, and is related to the number and pattern of the CCD pixels triggered for a given event. Single pixel events have PATTERN == 0, while double pixel events have PATTERN in [1:4] and triple and quadruple events have PATTERN in [5:12].

The second keyword in the expressions, PI, selects the preferred pulse height of the event. For the MOS, it should be between 200 and 12000 eV. This should clean up the image significantly with most of the rest of the obvious contamination due to low pulse height events. Setting the lower PI channel limit somewhat higher (e.g., to 300 or 400 eV) will eliminate much of the rest.

Finally, the #XMMEA_EM filter provides a canned screening set of FLAG values for the event. (The FLAG value provides a bit encoding of various event conditions, e.g., near hot pixels or outside of the field of view. Setting FLAG == 0 in the selection expression provides the most conservative screening criteria and usually is not necessary for the MOS.)

To filter the data using xmmselect,

  1. Enter the filtering criteria in the "Selection Expression" area at the top of the xmmselect window:
       (PATTERN <= 12)&&(PI in [200:12000])&&#XMMEA_EM
    
  2. Click on the "Filtered Table" box at the lower left of the xmmselect GUI. This will bring up the evselect GUI.
  3. In the "General" tab, change the filteredset parameter, the output file name, to something useful, e.g., mos1_te_filt.fits.
  4. Click "Run".

Remember to do the same for the image event file if you plan to use it.

Make a Light Curve

Sometimes, it is necessary to use filters on time in addition to those mentioned above. This is because of soft proton background flaring, which can have count rates of 100 counts/sec or higher across the entire bandpass. To determine if our observation is affected by background flaring, we can make a light curve by calling xmmselect and loading the event file as shown above. Then,

  1. Check the round box to the left of the "Time" entry.
  2. Click on the "OGIP Rate Curve" button near the bottom of the page. This brings up the evselect GUI (see Figure 2).
  3. Click on the "Lightcurve" tab and change the "timebinsize" to a reasonable amount, e.g. 20 s. In the "rateset" textbox, enter the name of the output file, for example, mos1_ltcrv.fits.
  4. Click on the "Run" button at the lower left corner of the evselect GUI.

Figure 2: The evselect GUI.

The output file mos1_ltcrv.fits is automatically displayed in Grace. It can also be viewed by using fv and is shown in Figure 3. No flares are evident, so we will continue to the next section. However, if a dataset does contain flaring, it should be removed in the same way as shown for EPIC IMAGING mode data here.

fv mos1_ltcrv.fits &

Figure 3: The Mkn 841 light curve.

Extract the Source and Background Spectra

First, we will need to make an image of the filtered event file. We will load the filtered event file into xmmselect, and then,

  1. Make an image by checking the square boxes to the left of the "RAWX" and "TIME" entries to indicate which is on the X and Y axis. Click the "Image" button near the bottom of the page. This brings up the evselect GUI.
  2. In the "Image" tab, enter the name of the output file in the imageset box; we will use mos1_te_image.fits. Toggle Binning to binSize, and confirm that ximagebinsize and yimagebinsize are set to 1.
  3. Click the "Run" button on the lower left corner of the evselect GUI. The image will be displayed automatically in a ds9 window.

Figure 4: An image of the Mkn 841 timing data.

The image is shown in Figure 4. The source is centered on RAWX=314. We will extract this and the 10 pixels on either side of it, keeping only the highest quality, single pattern events (FLAG==0 && PATTERN==0)).

  1. Enter the filtering criteria in the "Selection Expression" area at the top of the xmmselect window: (FLAG==0) && (PATTERN==0) && (RAWX in [304:324]).
  2. Click the round button next the PI column on the xmmselect GUI
  3. Click on "OGIP Spectrum".
  4. In the "General" tab, check keepfilteroutput and withfilteredset. In the filteredset box, enter the name of the event file output. We will use mos1_filt_source.fits.
  5. In the "Spectrum" tab, set the file name and binning parameters for the spectrum. Confirm that withspectrumset is checked. Set spectrumset to the desired output name. We will use source_pi.fits. Confirm that withspecranges is checked. Set specchannelmin to 0 and specchannelmax to 11999.
  6. Click "Run".

If needed, we can also extract a background spectrum. For this, we will use the imaging event list, since we want the background to be as far away from the source as possible. As with the source spectrum, we will need to make an image first. We will load the filtered image event file mos1_ie_filt.fits into xmmselect, and then,

  1. Make an image by checking the square boxes to the left of the "DETX" and "DETY" entries to indicate which is on the X and Y axis. Click the "Image" button near the bottom of the page. This brings up the evselect GUI.
  2. In the "Image" tab, enter the name of the output file in the imageset box; we will use mos1_ie_image.fits. Toggle Binning to binSize, and let ximagebinsize and yimagebinsize be set to 100.
  3. Click the "Run" button on the lower left corner of the evselect GUI. The image will be displayed automatically in a ds9 window.

The image is shown in Figure 5, with the background extraction region overlayed. Once again, we will only keep the high quality events, but we'll loosen the restriction on the event pattern a bit, using patterns 0, 1, and 3, since we're using the outer CCDs.

  1. Enter the filtering criteria in the "Selection Expression" area at the top of the xmmselect window: (FLAG==0) && (PATTERN<=1 || PATTERN==3) && ((DETX,DETY) in BOX(301.5,-13735.5,10700,4000,0))
  2. Click the round button next the PI column on the xmmselect GUI
  3. Click on "OGIP Spectrum".
  4. In the "General" tab, check keepfilteroutput and withfilteredset. In the filteredset box, enter the name of the event file output. We will use mos1_filt_bkg.fits.
  5. In the "Spectrum" tab, set the file name and binning parameters for the spectrum. Confirm that withspectrumset is checked. Set spectrumset to the desired output name. We will use bkg_pi.fits. Confirm that withspecranges is checked. Set specchannelmin to 0 and specchannelmax to 11999.
  6. Click "Run".

Figure 5: The filtered imaging event file for Mkn 841. The green box indicates the region where the background spectrum was extracted.

Check for Pile Up

Depending on how bright the source is and what modes the EPIC detectors are in, event pile up may be a problem. Pile up occurs when a source is so bright that incoming X-rays strike two neighboring pixels or the same pixel in the CCD more than once in a read-out cycle. In such cases the energies of the two events are in effect added together to form one event. Pile up and how to deal with it are discussed at length here and here, respectively, and users are strongly encouraged to refer to those sections.

In our example case, the source is far too faint to be piled up, but it is always a good idea to check anyway. We can quickly re-filter the event file to include single and double pixel events (patterns 0 and 1) and run epatplot to check for pile up. Invoke xmmselect to load the timing event file mos1_te_filt.fits, then

  1. Enter the filtering criteria in the "Selection Expression" area at the top of the window: (FLAG==0) && (PATTERN<=1) && (RAWX in [304:324])
  2. Click on "Filtered Table".
  3. In the "General" tab, check keepfilteroutput and withfilteredset. In the filteredset box, enter the name of the file output. We will use mos1_te_filt_source_epat.fits.
  4. Click "Run".
Now we can invoke epatplot, and
  1. In the "0" tab, enter the name of the event file, mos1_te_filt_source_epat.fits, the set text box. We want to send the output to a postscript file, so set useplotfile to yes, and enter the file name in the plotfile box. We will use source_epat.ps.
  2. In the "1" tab, set withbackgroundset to yes and enter the name of the event file that was made when the background spectrum was made, mos1_filt_bkg.fits.
  3. Click "Run".

The output is shown in Figure 6. Examining the lower plot, we see that there is excellent agreement between the modeled and observed single and double pattern events, and the observed-to-model fraction for doubles is < 1.0, indicating that the observation is not affected by pile up.

It should be noted, however, that if you are working with a dataset that is piled up, it should be treated the same way as piled up PN TIMING (or IMAGING) data, that is, by using only single pixel events, and/or removing the regions with very high count rates, checking the amount of pile up, and repeating until it is no longer a problem. A walk-through that details how to deal with piled up TIMING data can be found here.

Figure 6: The output of epatplot.

Determine the Spectrum Extraction Areas

The source and background region areas can now be found. (This process is identical to that used for IMAGING data.) This is done with the task backscale, which takes into account any bad pixels or chip gaps, and writes the result into the BACKSCAL keyword of the spectrum table. To find the source and background extraction areas, call backscale and then

  1. In the "Main" tab, enter the name of the spectrum, source_pi.fits.
  2. In the "Effects" tab, confirm that withbadpixcorr is checked, and enter the name of the event file, mos1_te_filt.fits, in badpixlocation.
  3. Click "Run".

Follow the same steps to find the background spectrum area, changing the event file in badpixlocation to mos1_ie_filt and the input spectrum file to bkg_pi.fits.

Create the Photon Redistribution Matrix (RMF) and Ancillary File (ARF)

Making the RMF for MOS data in TIMING mode is exactly the same as in IMAGING mode, which is demonstrated here. If the boresight was not excised (as may be necessary if your data is piled up), making the ARF is the same, as well. To make the RMF, call rmfgen from the SAS GUI and then

  1. In the "main" tab, set rmfset to the output file name. We will use source_rmf.fits. Set the spectrumset parameter to the spectrum, source_pi.fits.
  2. Click "Run".

Now use the RMF, spectrum, and event file to make the ancillary file. Invoke arfgen from the SAS GUI, and then

  1. In the "main" tab, set arfset to the output file name. We will use source_arf.fits. Set the spectrumset parameter to the spectrum, source_pi.fits.
  2. In the "calibration" tab, set withrmfset to yes and rmfset to the RMF file, source_rmf.fits.
  3. In the "effects" tab, verify that withbadpixcorr is checked, and set badpixlocation to the event file, mos1_te_filt.fits.
  4. Click "Run".

However, if you had to remove piled up sections, you will need to make an ARF for the full extraction area, another one for the piled up area, and then subtract the two to find the ARF for the non-piled regions. Users are referred to this discussion, where the procedure is demonstrated on PN TIMING data.

The spectrum can be fit using HEASoft or CIAO packages, as SAS does not include fitting software.


If you have any questions concerning XMM-Newton send e-mail to xmmhelp@lists.nasa.gov

This file was last modified on Tuesday, 19-Nov-2013 17:08:40 EST
Curator:Michael Arida (ADNET); michael.arida@nasa.gov

NASA Astrophysics

  • FAQ/Comments/Feedback
  • Education Resources
  • Download Adobe Acrobat
  • A service of the Astrophysics Science Division (ASD) at NASA/ GSFC

    XMM-Newton Project Scientist: Dr. Steve Snowden

    Responsible NASA Official: Phil Newman

    Privacy Policy and Important Notices.