Документ взят из кэша поисковой машины. Адрес оригинального документа : http://xmm.vilspa.esa.es/sas/5.4.1/doc/embadpixfind.ps.gz
Дата изменения: Fri Jan 10 22:54:25 2003
Дата индексирования: Tue Oct 2 11:17:08 2012
Кодировка:

Поисковые слова: integral
XMM-Newton Science Analysis System Page: 1
embadpix nd
January 10, 2003
Abstract
Find EPIC-MOS bad pixels for one node of one EPIC-MOS CCD.
1 Instruments/Modes
Instrument Mode
EPIC MOS IMAGING
2 Use
pipeline processing yes
interactive analysis yes
3 Description
embadpix nd aims at nding bad pixels in an EPIC-MOS image in a completely automatic way, by
taking advantage of the broad PSF in pixel units, which makes it impossible to mistake a source for a
bad pixel.
3.1 Preparatory work
Call emeventsproj with rejectbadevents=Y to project the events le to an image. An image built by
evselect would be accepted as well, but would not include the secondary pixels of multiple events (this
may miss weak bad pixels next to a strong one).
For optimal electronic noise rejection, the events le should be built by successive calls to emevents
(analysepatterns=N flagbadpixels=N splitdiagonals=N randomizeposition=N allow it to run
much faster) and emenergy (correctcti=N correctgain=N randomizeenergy=N allow it to run
much faster).
Call the FTOOL fmedian to perform median ltering onto the output image. The median ltering allows
to estimate reliably the average local value, whereas the standard average would be a ected by the bright
xmmsas 20030110 1802-5.4.1

XMM-Newton Science Analysis System Page: 2
pixels themselves. The recommended setting is 5 5 boundary=re ect (5x5 square window). Another way
of estimating the expected counts in the image would be accepted as well by embadpix nd.
For calibration purposes, it is possible to improve the statistics (and the sensitivity to weak bright pixels
or dark pixels) by stacking many images output of emeventsproj on top of one another before calling
fmedian and embadpix nd.
3.2 Basic algorithm
embadpix nd estimates an upper limit to the local statistical average from the median + 1 (1 is added
to take care of the case when the median is 0). Then it builds a map of local excesses in units of the local
statistical dispersion (Poisson regime) by subtracting the estimated average and dividing by its square
root. This map of local excesses is then used to locate the most promising candidate bad pixels. They are
examined in turn, in decreasing order. The local statistical average or median+1 (whichever is smaller)
is recomputed ignoring the candidate bad pixel. From the Poisson distribution at that value is deduced
the threshold in counts corresponding to probathreshold divided by the number of pixels in the window
used for median ltering (normally 24). If the local count number is larger than that threshold, the pixel
is agged as bright, the median is recomputed around the bad pixel ignoring it, and the loop goes on. If
the local count number is smaller than the threshold then the loop stops.
In a second step (if findbadsegments=Y) embadpix nd looks for too bright rows and columns. This
is done by projecting the image along rows and columns, and applying the same algorithm as above on
the resulting 1-D vectors.
If a bright row or column is found, it is analysed to look for bright segments within. If it is found that
the rest of the row/column is compatible (to 10% probability) with the neighboring rows/columns, then
only the bright segments are declared as bad. The minimum length of the bright segments is set such
that one expects about 1 count in that length in the normal (not bright) parts.
3.3 Dark pixels
If finddead=Y, embadpix nd looks for too dark pixels, rows and columns using the same algorithm
(but reversed to look for holes). The statistics in a single observation is usually not enough to nd any
dark pixel, but dark rows or columns may be found. The maxratio parameter avoids detecting 'grey'
pixels, rows or columns on observations with high statistics.
Whatever findbright, the very bright pixels/rows/columns (found at probathreshold squared) are
looked for rst (some are so bright that they can disrupt the more subtle row and column searches). If
both findbright=Y and finddead=Y, dark columns, rows and pixels are looked for rst and ignored in
the search for bright pixels (at the normal probathreshold), columns and rows, to avoid underestimating
the local median and average.
3.4 Calibration access
If usecal= Y, the uplinked bright pixels and known dead pixels (within the current window) are read
from the CAL and those pixels are ignored in computing the local median and the threshold.
Optionally (includedeadpixels parameter) one may include the dead pixels from the CAL in the output
list. This allows then to run badpix with getnewbadpix=Y getotherbadpix=N, to keep only the bright
pixels active in the current exposure while preserving the information about dead pixels.
If usecal= Y, the point spread function (at the center of the eld of view) is read from the CAL and the
xmmsas 20030110 1802-5.4.1

XMM-Newton Science Analysis System Page: 3
ratio between the peak and the average in a 5x5 window (typically 1.5 for MOS) is taken into account
when computing the threshold. The same ratio on 1-D pro les (typically 1.2 for MOS) is taken into
account when looking for bright rows or columns. The point spread function is not used when looking
for dark pixels, rows or columns.
Because the MOS1 PSF in the CCF is not peaked enough, the above recipe wrongly rejects the core of
very bright sources as bright pixels. While the MOS1 PSF in the CCF is being reworked, embadpix nd
uses a hardcoded version of the MOS1 PSF obtained on a very bright (but not too piled-up) source.
With usecal=N, the embadpix nd algorithm is not XMM speci c at all and works on any images
where the normal structure size is larger than 5 pixels.
3.5 Incremental search
The default mode is to ignore the bad pixels le on input. If incremental=Y, embadpix nd reads the
bad pixels le on input, and ignores the pixels mentioned there in the search. On output the bad pixels
le contains both the original bad pixels and the newly found ones.
4 Parameters
This section documents the parameters recognized by this task (if any).
Parameter Mand Type Default Constraints
evimageset yes dataset ' ' none
Input image le (from emeventsproj)
medianset yes dataset ' ' none
Smoothed image le (from fmedian)
badpixset no dataset badpix.out none
Output bad pixels le
incremental no boolean no yes/no
Add newly found bad pixels to the bad pixels le contents
probathreshold no real 1:10 6 > 0; < 1:10 3
False detection probability per pixel
ndbadsegments no boolean yes yes/no
Look for bad segments of rows or columns as well
ndbright no boolean yes yes/no
Look for too bright pixels, rows and columns
nddead no boolean yes yes/no
Look for too dark pixels, rows and columns
maxratio no real 0.5 > 0; < 1
Maximum ratio to neighbours for dark features (when finddead=Y)
xmmsas 20030110 1802-5.4.1

XMM-Newton Science Analysis System Page: 4
usecal no boolean yes yes/no
Get uplinked and dead pixels from the CAL
includedeadpixels no boolean no yes/no
Include dead pixels from CAL in output list
5 Errors
This section documents warnings and errors generated by this task (if any). Note that warnings and
errors can also be generated in the SAS infrastructure libraries, in which case they would not be docu-
mented here. Refer to the index of all errors and warnings available in the HTML version of the SAS
documentation.
ndAllBad01 (error)
input images do not have the same dimensions
getParamValues04 (error)
keyword incompatibility between input images
getParamValues03 (error)
keyword incompatibility between image and bad pixels les (incremental=Y)
ndBadPix11 (warning)
less than 5 good pixels around current pixel
corrective action: count pixel as bad
ndBadCol11 (warning)
less than 2 good rows/columns around current one
corrective action: count row/column as bad
getCalBadpix10 (warning)
bright pixel wrongly declared as uplinked in the CCF
corrective action: treat that pixel as not uplinked
6 Input Files
1. Projected image le (from emeventsproj) as Integer*4 array in PRIMARY. If they exist, the
window keywords WINDOWX0, WINDOWDX, WINDOWY0 and WINDOWDY are read to avoid underes-
timating the median and average at the borders in window mode.
2. Smoothed image le (from fmedian) as Integer*4 array in PRIMARY.
3. File with BADPIX extension (if incremental=Y) output of badpix nd, embadpix nd or
badpix.
xmmsas 20030110 1802-5.4.1

XMM-Newton Science Analysis System Page: 5
7 Output Files
1. Bad pixels le (for badpix) as BADPIX extension with RAWX, RAWY, TYPE, YEXTENT and
BADFLAG Integer*2 columns.
8 Algorithm
Read the parameters
Define goodPixels array, set to True
if incremental then
Read the bad pixels already in file
goodPixels(bad pixels) = False
endif
if usecal then
Read the bad pixels in CAL
goodPixels(uplinked and dead pixel) = False
if includedeadpixels then Write dead pixels to output list
Read point spread function psf
endif
Read map = projected image
Read medsmooth = median-smoothed image
if finddead call findAllBad(map, medsmooth, psf=flat, negative=Y, bad)
if findbright call findAllBad(map, medsmooth, psf, negative=N, bad)
Write bad pixels file
subroutine findAllBad(map, medsmooth, psf, negative, bad)
Get ratio in psf between peak and local average cpsf2D and cpsf1D
if negative then cpsfmed=maxratio else cpsfmed=cpsf2D
medroot = sqrt(real(medsmooth+1))
! Estimate the local excesses in rms units
badtest = (map - medsmooth*cpsfmed) / medroot
Loop over current bad pixel
Find maximum in badtest (minimum if negative)
goodPixel(maximum) = False
Compute median mu in 5x5 window where goodPixels = True
Multiply mu by cpsfmed (recomputed where goodPixels = True)
epsilon = probathreshold / Num(goodPixels in window)
Get threshold for Poisson(mu) at epsilon level (1-epsilon if negative)
xmmsas\_20030110\_1802-5.4.1

XMM-Newton Science Analysis System Page: 6
if maximum > threshold (< if negative) then
add bad pixel to list
Recompute badtest around maximum
else
exit loop
endif
endloop
if findbadsegments then
! Look for bright columns
profil = sum(map,2)
Find bad columns in profil
Loop over bad columns
width = 1/(expected count rate per pixel)
Get running integral over bins of width pixels
While total(rest of column) larger (lower if negative) than expected
Find maximum integral (minimum if negative)
Remove segment of width pixels around it
endwhile
endloop
endif
end subroutine findAllBad
9 Comments
 The algorithm to get the local average could be improved over using the local median. An
algorithm similar to that used in computing the o sets in emdiag should be considered.
References
xmmsas 20030110 1802-5.4.1