Exercise 4: Writing Out Pha And Bak Files

rmfit uses PHA2 files i.e., fits files with multiple spectra. XSPEC uses PHA files i.e., files with a single spectrum, and expects a background file that is suitable for the spectrum provided by the user. Having chosen a suitable source region for a time-integrated spectral analysis, and having fit the background around this region, we will now save that information in a form that can be used in XSPEC. The files resulting from this analysis will be used in a joint GBM-Swift analysis later this week. It is also possible to do this joint analysis in rmfit, by keeping the GBM data files as they are currently, and reading in a single PHA Swift BAT file (the background is already subtracted) and its corresponding response, but there is currently no way in rmfit to deal with Swift XRT response files so XSPEC must be used for a joint GBM-Swift XRT spectral study.

(i) In the lightcurve window for n6, with your source region selected as 0.5 - 1.0 s, click the 'Misc' button along the top menu.
Select 'Background -> PHA' and use the default name. This saves a .BAK file for use in XSPEC.

It is very important to have saved your selections in a lookup file before the next step as you will be undoing your background selection.

(ii) Click 'Fit Background' and remove your background fit. To do this, click in the right margin of the plot to reset the intervals, then click in the left margin to accept a 'No background' selection.

(iii) Click the 'Misc' button along the top menu.
Select 'Selection -> PHA' and use the default name, which will end in .PHA. You will be warned that no background exists. This is ok as it is exactly what you want.

(iv) Read your background selection back in by using the 'File' button on the top menu. Select 'Lookup' then 'Read Lookup' and pick your saved information from the ensuing file list.

(v) Repeat steps (i) through (iv) for the other detectors you are using.

Return to lesson