THE XMM-NEWTON ABC GUIDE, STREAMLINED
EPIC-MOS (TIMING mode), Hera Command Window
Prepare the Data
Reprocess the Data
Make a Light Curve
Apply Standard Filters
Apply Time Filters
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)
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). Setting the environment paraters follows the same syntax as the cshell in linux. To set the environment parameters and make the ccf.cif file, navigate into the ODF directory and in the Command Window, type
setenv SAS_ODF /data/0070740101/ODF setenv SAS_ODFPATH /data/0070740101/ODF cifbuildTo use the updated CIF file in further processing, you will need to reset the environment variable SAS_CCF:
setenv SAS_CCF /data/0070740101/ODF/ccf.cifThe 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. To run odfingest and reset the environment variable:
odfingest setenv SAS_ODF /data/0070740101/ODF/0201_0070740101_SCX00000SUM.SAS
cd ../ mkdir reproc cd reproc emchainor
emprocBy default, these tasks do not keep any intermediate files they generate. Emchain maintains the usual naming convention. Emproc designates its output event files with "TimingEvts.ds". In any case, it is convenient to rename them something easy to type; this can be done by clicking on the pen icon next to the file name in the User Account Window. We'll assume the new name for the event file is 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. We will rename the image event file mos1_ie.fits.
To create a light curve, type
evselect table=mos1_te.fits rateset=mos1_ltcrv.fits maketimecolumn=yes \ timebinsize=20 makeratecolumn=yeswhere
table - input event table
rateset - name of output light curve file
maketimecolumn - make a time column
timebinsize - time binning (seconds)
makeratecolumn - make a count rate column, otherwise a count column will be created
The output file mos1_ltcrv.fits can be viewed by downloading it and
using fv, as shown in Figure 1.
- fv mos1_ltcrv.fits &
(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, type
evselect table=mos1_te.fits filteredset=mos1_te_filt.fits \ expression='(PATTERN <= 12) && (PI in [200:12000]) && #XMMEA_EM'and, if you're using the image event file,
evselect table=mos1_ie.fits filteredset=mos1_ie_filt.fits \ expression='(PATTERN <= 12) && (PI in [200:12000]) && #XMMEA_EM'where
table - input event table
expression - filtering expression
filteredset - output file name
To determine if there is flaring in the observation, make a light curve and display it. No flares are evident, so we will continue to the next section. However, if a given dataset does contain flaring, it should be removed in the same way as shown for EPIC IMAGING mode data here.
evselect table=mos1_te_filt.fits imagebinning=binSize \ imageset=mos1_te_image.fits withimageset=yes \ xcolumn=RAWX ycolumn=TIME ximagebinsize=1 yimagebinsize=1where the keywords are the same as for applying standard filters, and
imagebinning - method of filtering
imageset - name of output image
xcolumn - column with x-coordinates
ycolumn - column with y-coordinates
ximagebinsize - binning factor for x-axis
yimagebinsize - binning factor for y-axis
The image can be downloaded and displayed with ds9. As can be seen in Figure 2, the source is centered on RAWX=314. We will extract this and the 2 pixels on either side of it.
evselect table=mos1_te_filt.fits withspectrumset=yes \ spectrumset=source_pi.fits energycolumn=PI spectralbinsize=5 \ withspecranges=yes specchannelmin=0 specchannelmax=11999 \ withfilteredset=yes filteredset=mos1_te_filt_source.fits \ expression='(FLAG==0) && (RAWX in [304:324])'where the keywords are the same as above, and
spectrumset - output spectrum name
energycolumn - name of the energy column
spectralbinsize - binning factor for spectrum
specchannelmin - minimum channel number
specchannelmax - maximum channel number
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.
evselect table=mos1_ie_filt.fits imagebinning=binSize \ imageset=mos1_ie_image.fits withimageset=yes \ xcolumn=DETX ycolumn=DETY ximagebinsize=100 yimagebinsize=100The image is shown in Figure 3, with the background extraction region overlayed. Now for the spectrum:
evselect table=mos1_ie_filt.fits withspectrumset=yes spectrumset=bkg_pi.fits \ energycolumn=PI spectralbinsize=5 withspecranges=yes specchannelmin=0 \ specchannelmax=11999 withfilteredset=yes filteredset=mos1_filt_bkg.fits \ expression='(FLAG==0) && ((DETX,DETY) in BOX(301.5,-13735.5,10700,4000,0))'