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

eimsim (eimsim-2.4.2) [xmmsas_20211130_0941-20.0.0]

Make a counts/pixel/sec image

This function may be performed alone by calling the script with entrystage and finalstage=`makerateimg'.

The process of converting the list of source positions and fluxes into a realistic XMM-Newton image consists of three stages:

  1. For each EPIC instrument, and within each band, make an ideal count-rate image (in theory of the whole sky, though in practice we don't bother with most of it). The units of this are (expected) counts per image pixel per second.
  2. Multiply this by the exposure map to create an ideal event-count image. In other words, what this creates is a map of the expectation value for the event counts at each pixel.
  3. Convert the expectation values to random, Poisson-distributed integer event counts.

The present function performs the first of these stages. Essentially this is done by adding an appropriate Point Spread Function (PSF) to the image for each sky location in the input source list. Ideally this would be done by reading a PSF from the XMM-Newton calibration data (the CCF). However in practice one finds that accessing this data is rather slow. Since there may be tens of thousands of simulated sources in the list, it is desirable to find some better procedure. For this reason it has been decided to use the CCF PSF only for those sources which are brighter than a user-settable flux level. For sources fainter than this level, the following axially-symmetric King function is used:

$\displaystyle S(x-x_0,y-y_0) = S_0 \ \left( 1+\frac{[x-x_0]^2 + [y-y_0]^2}{\rho^2} \right)^{-\alpha}.
The parameters $\rho$ and $\alpha$ are also settable by the user, but the default values, which are taken from values fitted to the on-axis PSF for the MOS camera (********** ref to RDS cal document XMM-SOC-CAL-TN-0018), should be perfectly adequate.

As said, the flux cutoff is a free parameter fluxcutoff of the eimsim script; the user is however advised to choose a value such that the proper, CCF PSF is used for all sources bright enough to be detectable. A few preliminary runs of eimsim may be required to determine a safe value.

Another point to consider is the size of the PSF `patches' which are added to the image. There are two related issues:

  1. How large should one make the patch array? `Twice the size of the image' is the ideal answer from a theoretical standpoint, so that there would always be complete overlap between the patch and the image, no matter where on the image the centre of the PSF was located. On the other hand, practical issues to do with memory and computing time argue for as small an array as possible. Another consideration is the detection procedure - if a PSF fitting algorithm is employed as part of this, for example as in the sas task emldetect, then it is clear that the PSF patch used here within eimsim must be at least as large as that used within the fitting procedure. Failure to do this will result in bias in the fitted flux values, as seems to have been the case in previous versions of eimsim.

  2. Should one vignet or `feather' the PSF patch in order to avoid an abrupt drop to zero at the edges of the patch? This becomes particularly important if a small patch size is chosen. On the other hand, an unwise choice of feathering function will give rise to flux biases in any fitting procedure employed in the source detection (see above).

The PSF array size in eimsim is at present `hard-wired' to the value of 21 by 21 pixels. The PSF parameters used for the faint sources result in a PSF which drops to about 9% of its central value at these array edges.

The feathering function chosen, let's call it $y$, is a piecewise inverted parabola, viz: $y=1$ for $\vert x \vert < fs$,

$\displaystyle y = 1 - \left( \frac{\vert x \vert - fs}{s(1-f)} \right)^2
for $fs \le \vert x \vert < s$, $y=0$ else. Here $x$ is the distance from the centre of the array, $s$ is the array half size (=10 in the present case) and $f$ (which should be between 0 and 1) is set somewhat arbitrarily to 0.7.

The effect of the feathering on the PSF is illustrated schematically in figures 1 to 3.

The bright sources are applied by use of the (XMM-specific) task esrcmap. This task obtains the PSF from the XMM calibration data via the cal library interface call CAL_getPSF, with the cal state variable accuracyLevel set to ACCURACY_MEDIUM. This returns a PSF which is interpolated from samples generated via a ray-tracing method. The source-detection task emldetect uses the same PSF by default.

The faint sources are added to the image by use of the non-XMM-specific equivalent task srcmap. This task uses the same PSF for each source, namely a King function. The relevant scale values are settable via srcmap, but not eimsim, parameters.

In order to preserve something close to realistic statistics in the background, it is usual to include, in the list of simulated sources, a large fraction which are too faint to be detected. This carpet of faint, confused sources supplies the desired `lumpiness', but at the cost of raising the average level of vignetted background. The approximate amount of the added background (in terms of flux in the simulated source energy band per unit sky area) can be estimated either from the first plot created by eimsimcompleteness, or by use of faintbackcalc. Once the added flux per square arcsec is known, it can be subtracted from the source images by use of eimsim (and srcmap) parameters withfluxoffset and fluxoffset.

XMM-Newton SOC -- 2021-11-30