We next run the XMM preprocessing chains to perform energy calibration and the like.

First make a new directory to store the processed data and change to that directory:

mkdir /scratch/phsdak/xmmproc
cd /scratch/phsdak/xmmproc

To run the processing chains, launch emacs and copy and paste the following into a script called allprepare (located in the above directory):

#!/bin/bash

xmmscripts=${XMMTOOLS}
xmmprepare=${xmmscripts}/xmmprepare
xmmextract=${xmmscripts}/xmmextract

odfroot=/scratch/phsdak/xmmodf/
odf=0112780401
datadir=${odfroot}/${odf}/ODF

${xmmprepare} --datadir=${datadir} --prepdir=${odf} --pn
${xmmprepare} --datadir=${datadir} --prepdir=${odf} --mos1
${xmmprepare} --datadir=${datadir} --prepdir=${odf} --mos2

Save the script and add execute permission

chmod ugo+x ./allprepare
You can then run the script:
./allprepare

This will take a few minutes. Note that for extracting further ODFs you can just copy the script and you have only to change the line defining the odf.

After running chains, note that there is one logfile for each of the cameras:

xmmprepare_0112780401_mos1.log
xmmprepare_0112780401_mos2.log
xmmprepare_0112780401_pn.log

Look through the logfiles to see whether there were any problems. Keep the logfiles since they are the documentation how the data were calibrated, and this saves you time in copying the relevant information into your labbook.