Birmingham XMM Guide: Scripts
The scripts below have been written to reduce and analyse XMM-Newton data in a fast and simple way. They make extensive use of the SAS tasks, and HEASOFT's FTOOLS utilities, as well as the Chandra analysis package CIAO (though this is mostly for non-essential purposes). Many of the scripts simply combine several SAS analysis steps together, however it is advisable to read through a script before using it, to be clear on what it does. Some of the scripts were written for a specific task, or dataset, and while they have been made as general as possible, there may be assumptions, or default values within them which are not what you want.
There are a couple of useful points to note when using these scripts:
- To see the input arguments required by a script, type its name with no arguments
- They (almost) all name the output files (root)aaaa.bbb where root is
a string specified when calling the script. This helps keep track of which
files were created by which script. Note, there is a script, root_change.csh
that changes the roots of files for you.
- It is ALWAYS a good idea to 'pipe' the output of a script to a log file,
called (root)log.txt, using tee. i.e.:
script.csh argument1 argument2 root |& tee rootlog.txt
This means you have a record of what the script did, and the arguments
you gave it. There are MANY occasions where doing this has saved my neck!!
To download an individual script, shift-click on its name in the list below. A zipped tarball containing all of the scripts is also available here.
The scripts are written in TCSH shell, and will run on linux or solaris machines. To use them, it's best to place them in a directory that's in your PATH, e.g. put them somewhere like /data/xmmscripts/ and then put this directory in your path,
setenv PATH ${PATH}:/data/xmmscripts
Or you could add this to your login script.
back to top
-
fverify.csh - version 1
-
Examines all files in a directory to see if they are FITS files, and reports any which aren't. Can be useful if you think some of your ODF files are corrupted.
-
xmmcomb_psf.csh - version 1
-
Combines the psfs of the 3 telescopes by adding the fits images created by
calview together, after weighting the PN telescope's psf by a factor of 2
because of its extra counts. The resulting image is then normailsed, so the
sum is 1
-
xmmexpmap.csh - version 1.1
-
Uses the SAS tool eexpmap to make an exposure map for an observation, then divides the image by it.
-
xmmfilter.csh - version 1
-
Useful script which acts as a front end for evselect, and can be used to
filter events, make images, spectra, and lightcurves.
-
xmmfkeycheck.csh - version 1
-
Compare the header keywords of two fits files, and reports any differences,
then copies any missing keywords from one header to the other.
-
xmmlight_clean.csh - version 3.3
-
Removes high background times from a dataset, and optionally filters on
flag, pattern, energy etc to produce a clean filtered events list. The cleaning is done by iterative 3-sigma clipping until the mean counts per time bin stabilises.
-
xmmmosaic.csh - version 1.3
-
Creates a combined image of 2 or 3 cameras, optionally weighted by their
respective exposure maps. Essentially combines the SAS tasks eexpmap and emosaic.
-
xmmsetup.csh - version 1.3
-
Sets environment variables, and runs odfingest and cifbuild if required.
Should be run in the odf directory.
-
xmmspec.csh - version 1
-
Extracts a source and background spectrum from ds9 regions, and creates
an arf and an rmf (or optionally uses a pregenerated rmf) then associates
the products and groups the spectrum.
-
xmmstring.csh - version 1
-
Useful script to convert a ds9 region file into a filter string that can
be used with evselect or xmmfilter.csh
-
upcase.csh - version 1
-
Uppercases all the filenames in a directory (uses upcase.pl from the
xmm website).
-
root_change.csh - version 1
-
Changes the root name of all the files in a directory.
-
2drprof_sherpascript.txt
-
An example 2-D surface brightness fitting sherpascript
back to top
Ben Maughan
Last modified: Mon Apr 29 12:17:34 BST 2002