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 . 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
espfilt eventfile=mos2S002.fits elow=2500 ehigh=8500
withsmoothing=yes smooth=51 rangescale=6.0
espfilt eventfile=pnS003.fits elow=2500 ehigh=8500
withsmoothing=yes smooth=51 rangescale=15.0
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.
The output of each run of espfilt is the following list of files:
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 ( for the MOS and 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.
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.