Back to eSASS task descriptions

eSASS task: ermldet

erosita/ermldet-1.35


Scope

This document provides a description of the algorithm and instructions for the correct usage of the ERMLDET task, which is part of eSASS (the eROSITA Science Analysis Software System).

Summary:

The task ERMLDET determines source parameters for a list of input sources from the file specified by parameter boxlist . The task uses a PSF fitting algorithm to fit a model of the source (either the PSF or a convolution of the PSF with an extent model) to the spatial distribution of counts taken from the images specified by parameter images . The primary set of fit parameters are x,y-position, count rates in each input image, and a source extent parameter. The fit parameters, derived quantities, and theit respective errors are written to the output source list specified by parameter mllist. Fitting of the source positions and source extent is optional and is controlled by the logical parameters fit_position and fit_extent . If shapelet_flag=no, the relevant PSF is read from the corresponding calibration image file, the relevant PSF calibration image is chosen using the header information in the science images and the energy interval given by emin and emax . In the case of shapelet_flag =yes, the SHAPELIB library routines are used to construct a source specific PSF, which is based on the positions and energies of the photons contributing to the respective source.

Algorithms:

The input source list is processed sequentially in descending order of likelihood from column LIKE . Neighbouring sources can also be fitted simultaneously as source clusters, the compilation of the source clusters is controlled by the parameters nmaxfit (maximum number of sources) and multrad (search radius). The task ERMLDET applies a PSF fitting algorithm to determine source parameters for a list of input positions. The source PSF can be generated using the following methods: A maximum likelihood fitting procedure is applied to the sources in the input list, starting with the most significant source and then working on the sources in the order of descending likelihood. Neighbouring sources can be combined for simultaneous fitting, and input positions can also be split up into multiple sources. The combination of the source clusters is controlled by the parameters nmaxfit (maximum number of sources) and multrad (search radius). The maximum number of splitted sources per input position is determined by the parameter nmulsou . The source models are generated using PSFs which are optionally (parameter fitext_flag=yes) folded with an extent model. Depending on parameter extent_model the extent model is either a Gaussian kernel or a beta model of the form

f(x,y)= [1 + ( (x-x0)2 + (y-y0)2) / rc2 ]-1.5

with the core radius rc as a free fit parameter. The models are multiplied with the exposure map to account for instrumental effects and the background is added. The model parameters are:

The source parameters are optimized by minimising the C-statistic (Cash 1979):

C=2i=1N(ei-nilnei)

where ei is the expected model value of pixel i, ni is number of photon events in pixel i, and N the total number of image pixels used for the fit. Once the fit has converged at a set of best fitting parameters, the significance of each source is tested by calculating

ΔC=Cnull-Cbest

where Cnull is the C-statistic of the null hypothesis (i.e. model with zero net counts) and Cbest is the value for the best fitting model. The fitting algorithm of ERMLDET can optionally obtain an individual PSF for each photon event depending on its energy and detector position (parameter photon_mode=yes). Where applicable, the event PSF is convolved with the extent model. In this mode the C-statistic is summed over the number of events rather than over the number of image pixels (unbinned likelihood).

The probability P that ΔC results from a chance fluctuation of the background is calculated using the regularised incomplete Gamma function PΓ :

P=1 - PΓ(ν/2 , ΔC/2)

For each source the logarithmic detection likelihood L = -ln(P)) is obtained. In case of simultaneous multi-source fits, sources falling below the user defined likelihood threshold are removed and the fitting procedure is iteratively repeated. After each model fit to a source or source cluster, the model is added to the background map. The final background + model maps can be written to the fits files srcimages. For the significant sources, 68% parameter errors are calculated by varying the parameter of interest from its best value in both directions until C = Cbest + 1.0 is reached. These boundaries are determined by an iterative procedure and the errors for both directions are averaged and written to the output table. In cases where for one direction the algorithm fails to converge after the given number of iterations, the errors determined for the other direction are adopted. In case no error margin can be determined in either direction, a zero is written to the output table. The positional errors are given in units of image pixels for both X and Y positions as well as an error radius (column RADEC_ERR) in units of arc seconds:

RADEC_ERR = pixelsize * √(X_IMA_ERR2 + Y_IMA_ERR2).

For derived quantities as the sum of count rates in multi-band fits or the hardness ratios between energy bands the count rate errors are propagated treating them like Gaussian errors.

Input parameters:

Input files:

Output files:

Examples:

1. Run ERMLDET on 2 images, allow simultaneous fitting of up to 3 input sources, use PSF from calibration images:
ermldet mllist=mllist.fits \
        boxlist=mboxlist.fits \
        images="image_soft.fits image_hard.fits" \
        expimages="image_soft_exp.fits image_hard_exp.fits" \
        detmasks="detmask.fits" \
        bkgimages="image_soft_bkg.fits image_hard_bkg.fits" \
        emin="500 2000"\
        emax="2000 5000" \
        hrdef="1 2" \
        ecf="2.0E12 1.0E12" \
        likemin=8. \
        extlikemin=10. \
        cutrad=15. \
        multrad=15. \
        extmin=1.5 \
        extmax=30.0 \
        expima_flag="Y" \
        detmask_flag="Y" \
        extentmodel="beta" \
        thres_flag="N" \
        nmaxfit=3 \
        nmulsou=1 \
        fitext_flag=yes \
        srcima_flag=yes \
        srcimages="image_soft_src.fits image_hard_src.fits" \
        expima_flag=yes \
        detmask_flag=yes \
        shapelet_flag=no \
        photon_flag=no \
        sixte_flag=no

2. Set srcima_flag=y and photon_flag=y to run ERMLDET using unbinned likelihoods:

ermldet mllist=mllist_photon.fits \
        boxlist=mboxlist.fits \
        images="image_soft.fits image_hard.fits" \
        expimages="image_soft_exp.fits image_hard_exp.fits" \
        detmasks="detmask.fits" \
        bkgimages="image_soft_bkg.fits image_hard_bkg.fits" \
        emin="500 2000"\
        emax="2000 5000" \
        hrdef="1 2" \
        ecf="2.0E12 1.0E12" \
        likemin=8. \
        extlikemin=10. \
        cutrad=15. \
        multrad=15. \
        extmin=1.5 \
        extmax=30.0 \
        expima_flag="Y" \
        detmask_flag="Y" \
        extentmodel="beta" \
        thres_flag="N" \
        nmaxfit=3 \
        nmulsou=1 \
        fitext_flag=yes \
        srcima_flag=yes \
        srcimages="image_soft_src_phot.fits image_hard_src_phot.fits" \
        expima_flag=yes \
        detmask_flag=yes \
        shapelet_flag=yes \
        photon_flag=yes \
        sixte_flag=no

Known issues: