XMM Backgrounds




An additional column was added to the XMM Background Files created by Andy Read in order to account for the differences in total exposure (due to point source removal). These files can be found in:

      /aibn156_a/dhudson/XMM-Newton/New_Backgrounds/
            or
      XMM_Backgrounds(Danny's home)

The additional column was created using a program called Weight_Bkg_Exposure.m, which can also be found in the same location (see below for details in using this program). Weight_Bkg_Exposure.m uses the exposure maps provided by Andy Read to determine the exposure time for each event. The weighting factor is the EXPOSURE keyword divided by the exposure time of the event. Some EPN exposure times are greater than the EXPOSURE keyword due to Out-Of-Time events (OOTs). Since it is impossible to remove these events from the event files, the exposure time of a particular pixel must include this time (6.3% for full-frame and 2.3% for extended full-frame). This leaves two possibilities:

      (1) Change the EXPOSURE keyword by adding the OOT time and weight based on that (so the smallest weighting factor is 1).
      (2) Weight based on the current EXPOSURE keyword and have some weights less than one (< 1).

The files I created apply the latter. The weighting factor is placed in a column called FRACEXP. When extracting spectra with evselect, include the options

      withzcolumn=T zcolumn="FRACEXP"

to create a spectrum with the correct exposure time for each photon. If you create a WEIGHT column with evigweight, then you can use fcalc to combine both weights into a third column called NETWGT.

e.g.
fcalc \
  infile=E2_0000ft_PN.fits+1 \
  outfile=obsbkg.fits \
  clname=NETWGT \
  expr="FRACEXP*WEIGHT" \
  copycol=yes \
  copyall=yes \
  clobber=yes




Running Weight_Bkg_Exposure.m

Although Weight_Bkg_Exposure.m is a stand-alone program, if you wish to run it yourself, you must take a few preliminary steps.
      (1) Make sure you have startup.m in $HOME/matlab (see web-site)
      (2) Make sure you have a LHEAsoft startup script (see web-site)
      (3) start up matlab...
                matlab -nojvm -nosplash


To run the program
      (1) help Weight_Bkg_Exposure will tell you how to run the program.

                help Weight_Bkg_Exposure

                Syntax Weight_Bkg_Exposure(bkg,exp,output,LHEAsoft_setup);
                bkg is the background events file
                exp is the raw Andy Read Exposure Map.
                output is the name of the output file
                LHEAsoft_setup is the location of the LHEAsoft setup script (e.g. ~/proto/LHEAsoft)

                This program creates a weight for every event based on its exposure time vs the total exposure time.

      (2) If it doesn't work...ask me and I'll be happy to show you.

Return to Software Page

Return to Main Page



Last Updated 9-Sep-05 by Danny Hudson