XMM-NEWTON DATA ANALYSIS WITH PERL SCRIPTS
The GOF has developed Perl scripts in an effort to simplify the EPIC data reduction process and make XMM data more accessible to astrophysicists and students who may not be very familiar with the details of working with SAS. These, plus a short guide to their use, and a summary of commands, are available below. Scripts for RGS and OM are currently in development. While knowledge of SAS is not required to run the scripts, SAS needs to be installed and initialized, and the environment variables set, for the scripts to run properly.
EPIC Scripts
A Walk-Through
Summary of Commands
EPIC Scripts
These are the available scripts with a short description of each. Clicking on each name will take you to a page with the script, where they can easily be saved by your browser.
- reprocess_epic: repipeline the data and apply standard filters.
- make_expmap_epic: make exposure maps based on default energy ranges or user-supplied ranges
- make_bkg_spectrum_epic: make a background spectrum
- make_filteredevents_epic: remove flares from event files
- make_image_epic: make images for display in ds9 or fv
- make_lc_epic: make light curves
- make_spectrum_epic: extract spectra, make RMFs and ARFs, and check for pile-up
After grabbing them with your browser, the easiest way to use these is to place them in a convenient directory and edit your .cshrc (or .bashrc or .zcshrc) file to look for them:
> cd ~And in your .cshrc, add:
> mkdir sas_scripts/
> mv *_epic sas_scripts/
alias make_image_epic 'perl ${HOME}/sas_scripts/make_image_epic'Remember to source your .cshrc to pick up the new aliases:
alias make_bkg_spectrum_epic 'perl ${HOME}/sas_scripts/make_bkg_spectrum_epic'
alias make_spectrum_epic 'perl ${HOME}/sas_scripts/make_spectrum_epic'
alias make_expmap_epic 'perl ${HOME}/sas_scripts/make_expmap_epic'
alias make_lc_epic 'perl ${HOME}/sas_scripts/make_lc_epic'
alias make_filteredevents_epic 'perl ${HOME}/sas_scripts/make_filteredevents_epic'
alias reprocess_epic 'perl ${HOME}/sas_scripts/reprocess_epic'
> source .cshrc
Please note that all scripts assume that SAS has been initialized and the
environmental variables have been set. We assume that the scripts have been
placed in a convenient directory and aliased, as shown above. All the steps
given here are the same as in the ABC Guide. In the example, we use the
observation of the Lockman Hole with ObsID 0147511601. As always when working
with SAS, be sure to call tasks from your working directory.
> cd ODF
> cd ../proc
There are two somewhat bright sources in the field. We can list these
in a text file, using the convention:
> more coords.txt
In pixel space, it would look like:
> more coords.txt
We can also make a file denoting background regions for these sources:
> more coords_bkg.txt
In pixel space, this would be
> more coords_bkg.txt
> make_image_epic
> make_lc_epic
> more bad_times.txt
To remove these time ranges, in the "proc" directory,
> make_filteredevents_epic
There will be several "DssBlockClash" warnings; these can be ignored. The
output will be placed in the working directory and follow the naming convention
"instrument_flt_evt2.fits".
Remember to update the events file list with the new files!
> make_spectrum_epic
> make_bkg_spectrum
> more energy.txt
it will produce two exposure maps for each event file, over the ranges 1-2 keV and
2-3 keV. If no energy file is entered, the default range 2-4.5 keV is used.
In any case, the output is placed in the "expmap" directory and follows the
naming convention "instrument_expmap_LowEnergy-HighEnergykeV.fits". In the "proc"
directory,
> make_expmap_epic
For our example, six exposure maps will be made: m1_expmap_1-2keV.fits, m1_expmap_2-3keV.fits,
m2_expmap_1-2keV.fits, m2_expmap_2-3keV.fits, pn_expmap_1-2keV.fits, and pn_expmap_2-3keV.fits.
You can reduce XMM data and extract useful products with minimal input by
using these commands and entering the appropriate text files when prompted.
> cd ODF
A Walk-Through
With these data products, further analysis can be done with XSpec or CIAO,
as shown in the ABC Guide.
> gunzip *gz
> reprocess_epic
> ls *evt2.fits > events.txt
unit
where
x y inner_radius outer_radius
unit = unit the coordinates and radii are in; can be either d
(decimal degrees) or p (pixels)
So the region file in degree space would look like:
inner_radius = inner radius of annulus region to extract. Set
this to 0 to extract a circular region.
outer_radius = outer radius of annulus region to extract. This
is equal to the radius of a circular region.
d
163.16561 57.409134 0 0.005
163.32071 57.597477 0 0.005
p
25748.549 18870.529 0 600
19765.33 32438.468 0 600
d
163.16561 57.409134 0.005 0.015
163.32071 57.597477 0.005 0.015
p
25748.549 18870.529 360 1080
19765.33 32438.468 360 1080
Enter the file listing the event files: events.txt
Should I use a region file? If so, enter the file name; otherwise, enter N: n
Enter the file listing the event files: events.txt
Should I use a region file? If so, enter the file name; otherwise, enter N: coords.txt
Please enter the size of the time bins. 10
1.54854e8 1.54865e8
1.54870e8 1.54873e8
1.54912e8 1.54921e8
1.54926e8 1.54952e8
Enter the file listing the event files: events.txt
Enter the file with the times to be removed: bad_times.txt
Enter the file listing the event files: events.txt
Enter the region file name: coords.txt
Enter the file listing the event files: events.txt
Enter the background region file name: coords_bkg.txt
1000 2000
2000 3000
Enter the file listing the event files: events.txt
Should I use an energy file? If so, enter the file name; otherwise, enter N: energy.txt
Summary
> reprocess_epic
> cd ../proc
> make_image_epic
> make_lightcurve_epic
> make_filteredevents_epic
> make_expmap_epic
> make_spectrum_epic
> make_bkg_spectrum_epic
If you have any questions concerning XMM-Newton
send e-mail to
xmmhelp@lists.nasa.gov
