XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


embadpixfind (embadpixfind-2.6.1) [xmmsas_20230412_1735-21.0.0]

Basic algorithm

embadpixfind estimates the local statistical average $\mu$ in a running window around each pixel by taking the smallest of the average or the median + 1 (1 is added to take care of the case when the median is 0, the median allows to remove the effect of other bad pixels in the vicinity). Then it builds a significance map via the Li and Ma criterion (Li & Ma 1983, ApJ 272, 317):

  $\displaystyle S \; = \; \sqrt{2} \: \sqrt{N_{\rm on} \, ln \frac{N_{\rm on}}{\mu_{\rm tot}}
+ N_{\rm off} \, ln \frac{\mu}{\mu_{\rm tot}}}
$ (1)
where $N_{\rm on}$ is the number of counts in the current pixel, $N_{\rm off} = N_{\rm pix} \, \mu$ is the number of reference counts, $N_{\rm pix}$ is the number of pixels used to compute the local average ((2 halfwidth2d + 1)$^2$ - 1, if none of the pixels in the window has been rejected already), $N_{\rm tot} = N_{\rm on} + N_{\rm off}$ is the total number of counts in the window, and $\mu_{\rm tot} = N_{\rm tot} / (N_{\rm pix}+1)$ is the average number of counts per pixel in the window.

This significance map is then used to locate the most promising candidate bad pixels. They are examined in turn, in decreasing order. The exact probability that the current excess is a statistical anomaly of a flat distribution is computed from the cumulative binomial law:

  $\displaystyle P(k \ge N_{\rm on}) \; = \; \sum_{k=N_{\rm on}}^{N_{\rm tot}}
p_B(k,N_{\rm tot},q)
\; = \; I_q(N_{\rm on},N_{\rm off}+1)
$ (2)
where $q = 1/(N_{\rm pix}+1)$ is the probability that a random count fall in the central pixel, and $I_x(a,b)$ is the incomplete beta function. This is significantly different from the probability estimated from Eq.(1) for small numbers (Eq.3 gives a larger probability). If that probability is smaller than probathreshold, the pixel is flagged as bright, the average is recomputed around the bad pixel ignoring it, and the loop goes on. The loop stops when the next largest excess is smaller than the significance corresponding to probathreshold.

XMM-Newton SOC -- 2023-04-16