Soft Proton Flare Filtering

Soft proton (SP) filtering is accomplished with the espfilt task. This task creates two light curves (one from the FOV data, and one from the corner data) in the 2.5-8.5 keV band, and creates an X-ray count rate histogram from the FOV data. For a typical observation the histogram will have a roughly Gaussian peak at some nominal count rate (the count rate during time intervals unaffected, or at least minimally affected, by SP contamination) with a higher count-rate tail. Depending on how contaminated the observation is, the Gaussian peak can be very well defined or just a small bump in the distribution. In the latter case, espfilt is unlikely to provide a reasonable result (it may even fail completely) and the observation is probably unusable for the study of extended sources. In the former case, espfilt will fit a reasonable Gaussian to the peak and determine thresholds at plus or minus $1.5\sigma$. The espfilt task then creates a GTI file for those time intervals with count rates within the thresholds and uses the task evselect to filter the data to create “cleaned” photon event files.

We stress that this process does not necessarily remove all of the SP contamination, it only removes time intervals with obvious contamination, i.e., where the count rate is significantly enhanced over a nominal level. In general this provides a reasonable method for minimizing the SP contamination while still leaving the best, and most of the time sufficient, data to be analyzed. One should check the diagnostic files to see how well the data have been cleaned.

The task input is an event file created with emchain or epchain. For the histogram method the execution can be simple:

espfilt eventfile=mos1S001.fits elow=2500 ehigh=8500
withsmoothing=yes smooth=51 rangescale=6.0
allowsigma=3.0 method=histogram
keepinterfiles=false
espfilt eventfile=mos2S002.fits elow=2500 ehigh=8500
withsmoothing=yes smooth=51 rangescale=6.0
allowsigma=3.0 method=histogram
keepinterfiles=false
espfilt eventfile=pnS003.fits elow=2500 ehigh=8500
withsmoothing=yes smooth=51 rangescale=15.0
allowsigma=3.0 method=histogram
withoot=Y ootfile=pnS003-oot.fits
keepinterfiles=false
The first two of these commands runs espfilt on the event files from MOS1 and MOS2. The last runs espfilt on the event file from the pn, and then applies the same time selection to the pn-oot event file as well.

Because the pn is more sensitive to the soft proton flares, the pn and MOS filtering may not produce consistent time intervals, that is, the MOS data may include intervals excluded from the pn data. It is up to the user to determine whether this is acceptable. (Yes, the pn may mark some times as being flared, but if the MOS data is not flagged, then the effect on the MOS data will likely be minimal.) Editing GTI files by hand to make the instruments have consistent time selection is currently painful.

There are a number of possible parameters that one can set in order to tweak the way the filtering is done. However, the defaults are the result of a substantial amount of testing, and thus are likely to work well. If there is a bright extended source in the FOV, increasing the rangescale to 10 for the MOS and 25 for the pn may be necessary to get a good fit.

Figure 7: Temporal filtering results for the MOS2S002 SWCX-1 exposure with ObsID 0402530201. The upper panel plots the light curve histogram for the $2.5-8.5$ keV band from the FOV, the middle panel displays the $2.5-8.5$ keV band FOV light curve, and the lower panel displays $2.5-8.5$ keV band light curve from the unexposed corners of the instrument. The histogram is derived from the smoothed light curve. In the upper panel, the blue vertical lines show the range for the Gaussian fit, the green curve shows the Gaussian fit, while the red vertical lines show the upper and lower bounds for filtering the data. In the bottom two panels green points indicate accepted data while black points indicate data excluded by the filtering algorithm. The high count rate excursions are produced by soft protons rather than a higher-energy particle background flare as the latter case would produce a mirror increase in the MOS corner data light curve. The pn corner data do show an increase with SP flares because of OOT events.
\includegraphics[width=12.0cm,angle=270.0]{mos2S002-hist.eps}

The output of each run of espfilt is the following list of files:

P-allevc.fits
- the filtered event list for all of the data, both FOV and corner. This file is used for all following steps.
P-allimc.fits
- diagnostic image of FOV and corners after filtering
P-corevc.fits
- the filtered event list for the corner data. This file can be used by mosspectra/pnspectra, but we recommend allowing mosspectra/pnspectra to create their own corner files, just in case the definition of the corner or the required flags changes in either espfilt or mosspectra/pnspectra.
P-corimc.fits
- diagnostic image of corner data after filtering
P-corlc.fits
- the light curve for the corner data
P-fovlc.fits
- the light curve for th FOV data
P-gti.fits
- the GTI file containing the intervals without soft proton flares
P-hist.qdp
where P is a prefix such as “mos1S001”. If keepinterfiles=true then the following files are kept as well:
P-corev
- the unfiltered event list for the corner data
P-corim.fits
- diagnostic image of corner data before filtering
P-allim.fits
- diagnostic image of FOV before filtering

Figure 8: Temporal filtering results for the MOS2S002 exposure of Abell 1795. Although the SP flaring is relatively minor, one can still see that some accepted time intervals are likely to contain some residual SP flare contamination. This plot is from an older version of ESAS.
\includegraphics[width=12.0cm,angle=270.0]{A1795-lc.eps}

Figure 9: Temporal filtering results for the MOS1 Magellanic Bridge observation (0049150201). The SP flaring is so strong and affects so much of the observation that the data were not useful for the study of the diffuse emission in the field. Even the roughly 2.5 ks of low count rate exposure are likely to be still contaminated with residual soft protons. This plot is from an older version of ESAS.
\includegraphics[width=12.0cm,angle=270]{bridge-lc.eps}

The QDP files should be plotted and examined to determine whether the exposure is actually useful (see Figures 7 and 9 for examples). Figure 8 shows the plot for the mos1S003 exposure from the Abell 1795 observation. This is a clear example where there is likely to be residual SP contamination, as evidenced by the slight ripple in the nominally constant level of the light curve. While the selection criteria could be tweaked to remove more of the contaminated time intervals, there would still be no guarantee that there isn't some finite minimum contamination at all times. Figure 9 shows the plot for an observation much more strongly affected by SP flaring where the data are effectively useless for studies of diffuse emission. Unfortunately for the authors, this was one of their observations.

To double check that the soft proton filtering worked well, compare the P-allimc.fits and the P-corimc.fits images. In the filtered file, the FOV should be indistinguishable from the corners if the SP filtering succeeded.

Of the files created by espfilt only P-allevc.fits and P-gti.fits need be saved for the future steps. The remaining files can be moved to wherever the diagnostic files are kept.

It should be noted that espfilt will not run for certain filters or submodes. Observations taken with the “CalClosed” filter are not processed because there is (by definition) no soft proton flaring seen when the filter is closed. espfilt will not run for pn observations taken in the timing or small window modes; there simply isn't enough area from which to determine the light curve of the background. espfilt does work for pn observations take in large window mode, even though those observations can't be used for further ESAS processing. espfilt will work on all MOS modes.

It should also be noted that espfilt silently applies a filter to the PATTERN ($\le12$ for the MOS and $\le4$ for the pn) and the FLAG ((FLAG & 0x766ab000)==0) for the MOS and #XMMEA_EP for the pn). If the user wishes to apply a different selection, the P-gti.fits file can be applied to whatever event file they desire, as below.

evselect table=input_file.fits
withfilteredset=yes filtertype=expression
expression='GTI(P-gti.fits,TIME)'
filteredset=output_file.fits
keepfilteroutput=yes updateexposure=yes
filterexposure=yes

The numbers listed in the histogram plot can be used for a reasonable (but not spectacularly good) automated determination of goodness of soft proton filtering.