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.
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:
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
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.
Source list with input positions. FITS binary table in the format as written by task ERBOX or ERMLDET. The file name is definbed by task parameter boxlist.
One or more FITS files as generated by task EVTOOL. The primary FITS extension of each file contains a science image as an int32 array. The file names are defined by task parameter images. In case task parameter shapelet_flag = yes is set, also the EVENTS and CORRATT extensions need to be present in the input files. Typically, the images of all active eROSITA telescope modules are added into one image and multiple images correspond to a set of non-overlapping energy bands. However, supplying images from multiple instruments is possible. The WCS coordinate systems of all input images have to be identical.
FITS images ( real32) as created by task EXPMAP for the same instruments, energy bands, and WCS coordinate systems as the science images. File names are defined by parameter expimages
FITS images ( real32) as created by task ERBACKMAP for each input science image. File names are defined by parameter bkgimages
FITS images ( int8) as created by task ERMASK with file names defined by parameter detmasks. The image areas with value =1 are used for detection, areas with value =0 are masked out. For multiple images from the same instrument, but for different energy bands, only one detection mask is required.
The source list is written to a FITS binary table extension, the file name is determined by the task parameter mllist. The table format is described in the following table:
|BOX_ID_SRC||int32||Input source ID|
|ID_BAND||int32||Index of energy band|
|ID_CLUSTER||int32||Group ID of simultaneously fitted sources|
|ML_CTS||real32||counts||Total source counts aperture corrected|
|ML_CTS_ERR||real32||counts||Total source counts aperture corrected|
|X_IMA||real32||pixel||Source position, image pixels|
|X_IMA_ERR||real32||pixel||Position error, image pixels|
|Y_IMA||real32||pixel||Source position, image pixels|
|Y_IMA_ERR||real32||pixel||Position error, image pixels|
|EXT||real32||arcsec||Extent value (core radius / sigma)|
|EXT_ERR||real32||arcsec||Extent value, error|
|EXT_LIKE||real32||Log-likelihood, extent probability|
|ML_BKG||real32||counts/arcmin**2||Background at source position|
|ML_EXP||real32||s||Exposure at source position|
|ML_FLUX||real32||erg /cm**2 /s||Source flux in energy band|
|ML_FLUX_ERR||real32||erg /cm**2 /s||Source flux error in energy band|
|ML_RATE||real32||counts/s||Source count rate, aperture corrected|
|ML_RATE_ERR||real32||counts/s||Source count rate error, aperture corrected|
|RADEC_ERR||arcsec||deg||Combined RA,DEC position error|
|RAWX||int32||det. pixel||Source position on detector|
|RAWY||int32||det. pixel||Source position on detector|
|OFFAX||real32||arcmin||Source off axis angle on detector|
|TM_NR||int32||Telescope module number|
|HR1||real32||Hardness ratio 1|
|HR1_ERR||real32||Hardness ratio error 1|
|HR2||real32||Hardness ratio 2|
|HR2_ERR||real32||Hardness ratio error 2|
|HR3||real32||Hardness ratio 3|
|HR3_ERR||real32||Hardness ratio error 3|
|ML_RADIUS||real32||arcsec||Radius of sub image for fitting|
|MASKFRAC||real32||Fraction of good pixels in ML_RADIUS|
|ML_EEF||real32||Encircled energy fraction in ML_RADIUS|
|VIGNET||real32||Source vignetting factor|
|ONTIME||real32||s||Source exposure elapsed time|
|DIST_NN||real32||Distance from nearest neighbour|
|OWNER||int8||Data ownership flag|
When the task parameter srcima_flag is set to Y, source maps are written to the FITS image files specified by parameter srcimages. The primary extension of each file (one for each input image) contains an image with the source model added to the input background map.
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