erbackmap
erosita/erbackmap-1.10
Summary:
Create smooth background by masking source regions in input image
and smoothing either by 2D spline fit or adaptive smoothing algorithm.
Description:
The task erbackmap creates the background images for the eROSITA source detection pipeline.
The input data are one science image, an input source list (typically created by task erbox in local mode),
an exposure map (from task expmap) and detection mask (from task ermask).
In a first step circular regions around the input sources are calculated, where the surface brightness of
the input sources exceed the threshold set by parameter scut . A mask image where this regions are set to 0
can optionally be written to the file specuified by parameter cheesemask .
The image data outside the source regions are used to create a smoothed background map which is also interpolated
to the positions of the input sources. The user can choose between a 2D spline fit (fitmethod="spline") and
an adaptive smoothing algorithm (fitmethod="smooth") to perform the smoothing/interpolation.
The spline fit can be controlled with the parameters nsplinenodes (number of spline nodes per dimension),
degree , smoothflag , smoothval . If smoothflag =Y, a smoothing spline with
smoothing factor smoothval is used. If smoothflag =N, a weighted
least-squares spline is used.
The adaptive smoothing algorithm (fitmethod="smooth") smoothes the masked image with a set of Gaussian kernels
and calculates a signal-to-noise map for each kernel size.
The SNR required for the background map is specified by the parameter snr .
The background map is then interpolated pixel by pixel from the 2 smoothed maps whose signal-to-noise ratios in the respective
pixels bracket the required SNR.
Parameters:
- image [="image.fits"] (string) REQUIRED
boxlist [="boxlist.fits"] (string) REQUIRED
expimage [="expimage.fits"] (string) OPTIONAL
expimage2 [="expimage2.fits"] (string) OPTIONAL
- Exposure map (unvignetted), currently not used
detmask [="detmask.fits"] (string) OPTIONAL
bkgimage [="bkgimage.fits"] (string) OPTIONAL
cheesemask [="cheeseimage.fits"] (string) REQUIRED
- Output image of mask used to remove sources
idband (integer) OPTIONAL
- Energy band index in boxlist column id_band (first band has id_band=1)
emin [=500.] (real_array) OPTIONAL
- Minimum energies [PI channels]
emax [=2000.] (real_array) OPTIONAL
- Maximum energies [PI channels]
scut [=0.05] (real_array) OPTIONAL
- Surface brightness limit [cts/pix] for source cutout
mlmin [=6.0] (real) OPTIONAL
- Minimum boxlist likelihood for sources to be removed
maxcut [=0.5] (real_array) OPTIONAL
- Maximum fraction of image area to be masked out
fitmethod[="spline"] (string) OPTIONAL
- Fit method (spline / smooth)
excesssigma [=4. (real) OPTIONAL
- fitmethod=spline: Sigma threshold for rejected bins
nfitrun[=3] (integer) OPTIONAL
- fitmethod=spline: Number of iterations for sigma clipping
nsplinenodes[=12] (integer) OPTIONAL
- fitmethod=spline: Number of spline nodes / spatial bins per dimension
degree[=3] (integer) OPTIONAL
- fitmethod=spline: Degree of the spline (1 .. 5)
smoothflag[=Y] (boolean) OPTIONAL
- fitmethod=spline: Use smoothing spline?
smoothval [=-1.] (real) OPTIONAL
- fitmethod=spline: Smoothing value, s > 0.0: absolute, if s < 0.0 : relative
snr [=30.] (real) OPTIONAL
- fitmethod=smooth: Required signal to noise ratio for adaptive smoothing
expima_flag[=Y] (boolean) OPTIONAL
expima2_flag[=Y] (boolean) OPTIONAL
- Use unvignetted exposure maps
cheesemask_flag[=Y] (boolean) OPTIONAL
- Write mask used to remove sources (cheese mask)
Input files:
- image
- boxlist
- expimage
- expimage2
- detmask
Output files:
Examples:
erbackmap image=image_soft.fits \
expimage=image_soft_exp.fits \
boxlist=boxlist_local.fits \
detmask=detmask.fits \
idband=1 \
emin=200. \
emax=500. \
bkgimage=image_soft_bkg.fits \
cheesemask=image_soft_cheese.fits \
scut=0.001 \
mlmin=6 \
maxcut=0.5 \
fitmethod=smooth \
snr=30. \
cheesemask_flag='Y'