SAS Thread - evenergyshift - XMM-Newton
CORRECT FOR RATE-DEPENDENT ENERGY SCALE EFFECTS IN pn BURST AND TIMING MODE
Introduction Bright sources observed with EPIC-pn Timing and Burst modes show count-rate dependent shifts in the energy scale. Nominally, these effects are corrected through the standard processing. However, the calibration is derived for a wide range of sources, and in some individual cases the generic correction is inadequate. This thread shows how to evaluate the validity of the energy scale (based on potential spectral residuals around the instrumental edges) and, if necessary, apply additional corrections through a specific SAS task. Expected Outcome The user will obtain an event list with an observation specific energy scale correction. SAS Tasks to be Used Prerequisites
Useful Links
Last Reviewed: 25 May 2023, for SAS v21.0Last Updated: 25 May 2023 |
Procedure
This thread contains a step-by-step procedure to analyse the spectrum of an EPIC-pn observation in Timing or Burst mode, estimate the energy shift necessary to eliminate or reduce possible spectral residuals around instrumental edges, and create a modified event file with the observation-specific energy scale correction applied.
The steps to follow in general terms are:
-
Reduce the data with the default processing (which includes the RDPHA correction), and extract the spectrum (if the observation is affected by pile-up, see the Caveats section below);
-
With XSPEC, check the residuals in the energy spectrum around the instrumental edges at 1.8 keV, 2.2 keV and 11.9 keV;
-
If there are significant residuals around one or more edges, isolate each of those instrumental edges and use the XSPEC command gain fit to find the energy shift necessary to reduce the residuals resulting from the default calibration;
-
Apply the resulting energy shift associated with each edge to the event file with the SAS task evenergyshift to create a corrected event file;
-
From the newly created, corrected event file, re-extract the energy spectrum and proceed with the spectral analysis.
We will detail here the case for an EPIC-pn observation made in Timing mode. For Burst mode observations the user can follow the same steps.
It is assumed that an event file called pn-events.fits already exists, from which an energy spectrum pn-spectrum.pi, a background spectrum pn-bkd-spectrum.pi and ancillary and response files pn.arf and pn.rmf, have been extracted.
With those four files, we can enter XSPEC to explore the spectrum and apply the corrections if necessary. Follow the steps below.
- Start XSPEC
xspec
- Load the source spectrum
data 1 data pn-spectrum.pi
- Load the background spectrum
backgrnd 1 background pn-bkd-spectrum.pi
- Load the redistribution matrix
response 1 response pn.rmf
- Load the ancillary file
arf 1 arf pn.arf
- Create the output graphic plotting window
cpd /xs
- Define how data has to be plotted (in this case energy scale)
setplot energy
- Ignore bad channels in data
ignore bad
- Ignore energy intervals where the pn matrices are currently not calibrated (e.g. beyond the energy band 0.2-15.0 keV)
ignore **-0.2 15.-**
(check the EPIC Calibration Status Document for recommended energy ranges to be used for the different modes and EPIC instruments)
- Plot and inspect the data
plot ldata
- Load the model to be fitted (in this case a simple power law model with photoelectric absorption)
model tbabs*po
- Fit the parameters
fit 100 1e-1
The former number indicates the maximum number of iterations before the minimization routine stops. The latter number indicates the difference in fit statistic between iterations below which the fit is deemed to have converged.
- Now examine the residuals at the instrumental edges, in this example the Au M-edge at 2.2 keV. For that, ignore the following energy intervals
ig **-1.8
ig 2.8-**
- Plot the narrowed energy range (it can be useful to plot in channel space, as is done here) with the current model and residuals
setplot ch
plot ldata deIf there are significant residuals (as in this example above), this could be an indication of a not fully correted energy scale in the default processing.
- Quantify the shift in energy scale required to minimise these residuals, using the XSPEC command gain fit
gain fit
- You will be prompted for the initial values of the slope and the offset of the gain correction - the slope should be fixed to 1, the offset should be a free parameter
- Enter 1,-1 for the slope, thus making it a fixed parameter.
- Hit return for the offset, making it a free parameter.
- Refit the data and derive the model parameters along with the best-fitting offset, which will be listed as the last parameter
fit 100 1e-1
plot ldata de
Note the gain offset value representing the energy shift corresponding to this instrumental edge. Repeat the same procedure for the edges at 1.8 keV and 11.9 keV (if meaningful).
- Now one may quit XSPEC
exit
Once we finished with XSPEC, the SAS task evenergyshift can be used to create an events file with the energy shifts derived above applied. Regarding the values passed, please note:
- the gain offset and corresponding edge energies should be expressed as integer eV, and
- the gain offset value should change sign (due to the different interpretation of the offset in XSPEC and evenergyshift)
In this example, the task would be called as follows:
evenergyshift table=pn-events.fit \
outset=pn-events-modified.fits pi1=2200 offset1=-97
this will apply an energy shift of -97 eV to all event energies.
If energy shifts are required at other instrumental edges, the call would be, e.g.:
evenergyshift table=pn-events.fits \
outset=pn-events-modified.fits pi1=1800 offset1=-50 pi2=2200 offset2=-97
In such cases, i.e. where different energy offset values (offset1, offset2, ...) are passed at multiple energies (pi1, pi2, ...), the default behaviour of evenergyshift is to apply energy shifts by linearly interpolating offset values between successive pi values, and extrapolating the trend beyond the highest pi value.
As mentioned, the default behaviour is to extrapolate the trend beyond the highest pi value, however, the extrapolation can be swiched off by passing the option extrapolate=no. In this case beyond the highest pi value a constant is assumed.
The resulting modified events file, pn-events-modified.fits, can now be used to re-extract the energy spectrum.
Caveats Please note the use of the option extrapolate=no as described above, if not, by default, the task will extrapolate the trend beyond the highest pi value. If your observation is affected by pile-up, check the corresponding section of the SAS User Guide (EPIC chapter, section How to analyse a piled-up Timing mode observation) for information on the analysis of piled-up Timing mode observations. See also the thread on How to evaluate the pile-up fraction in an EPIC source. |