Scope
This document provides a description of the algorithm and instructions
for the correct usage of the
SRCTOOL
task, part of the
eSASS (the
eROSITA Science Analysis Software System) suite.
Description
SRCTOOL is the software tool used to derive source level
products (spectra, light-curves and corresponding instrumental correction vectors/matrices)
from calibrated
eROSITA event files and their ancillary
meta-data. Figure 1 gives a graphical representation of the inputs and
outputs of
SRCTOOL.
Figure 1. An illustration of the main inputs (left side) and outputs (right side) of SRCTOOL.
Inputs include calibrated event list files (including meta-data), source description files
(catalogues, regions, extent models) and calibration data files (read from the CALDB).
Outputs include source and background spectra, light-curves, response matrices, ancillary
response files, and eventlists.
SRCTOOL is used both within the standard
eSASS pipeline (operated in an
automatic scripted way), and also as a user-facing tool (manually called). Hence
there are a number of different modes of operation, and a variety of distinct tasks that are carried out
by
SRCTOOL. Not all of this functionality is necessarily used in each call
of
SRCTOOL, and sometimes a subset of the input parameters will have no effect.
Words of advice/caution
-
SRCTOOL was originally designed and optimised for the
extraction of (and correction of) point-like and moderately
extended, circularly symmetric sources. There is also a mode to
better handle very large (and arbitrarily shaped) extended sources,
with the caveat that this mode does not correct for PSF losses.
-
Calculation of correction vectors (ARFs and light-curve
corrections) is computationally demanding, and so SRCTOOL can
take a long time to process certain combinations of
eventlists/source descriptions. The accuracy parameters tstep
and xgrid strongly affect processing time, so please pay
attention to their descriptions below.
-
When computing light-curves, SRCTOOL does not attempt to make
any corrections for valid event patterns (singles, double, triple, quadruples)
that fall outside the pattern
selections given in the eventlist keyword PAT_SEL. Therefore,
one should only directly compare the corrected count rates of
two sources if their light-curves have been extracted using
identical pattern selections. Pattern selections are taken into
account by SRCTOOL when computing response matrices for spectral products.
-
Astrometric (in)accuracy. SRCTOOL expects RA,DEC coordinates in eROSITA
eventfiles and catalogues to be in the ICRS coordinate system.
SRCTOOL treats any user-supplied coordinates (including region descriptions) that
are given as 'FK5' or 'J2000' as though they are actually in the ICRS coordinate system.
This is a reasonable approximation given the expected accuracy of the attitude
reconstruction for eROSITA.
Input Parameters
-
eventfiles (string array) REQUIRED [e.g. "eventfile1.fits eventfile2.fits"]
- A (space separated) list of input calibrated eventfiles (in FITS format).
See below for a description of the format and permitted combinations of input eventfiles.
- Note that calling SRCTOOL with "--version" (or "-v") as the first and only parameter
causes SRCTOOL to print out its own version number and then to exit.
- srccoord (string) REQUIRED [e.g. "icrs;12:34:56.7,+12:34:56.7"]
- Description of the target coordinates.
Coordinates can be supplied in one of the following formats:
- A single longitude,latitude pair in decimal degrees or sexadecimal format, separated by a single comma,
and optionally prefaced by a coordinate system code: e.g.
- "gal; 12:34:56.7, +12:34:56.7"
- "ecl; 12h34m56.7s, +12d34'56.7""
- "fk4; 12.34567, +12.34567"
Valid coordinate system codes are: "icrs", "fk5", "fk4", "gal", "ecl", "j2000", "b1950", and their upper-case equivalents.
When the coordinate system code is omitted, we assume "icrs".
Coordinates given in the "fk4", "gal", "ecl", and "b1950" systems are converted internally into "icrs".
- A single line SAO/DS9 format region description, using one of the region types which
has the central coordinates as its first and second arguments. e.g.
- "icrs; circle(12.34567,+12.34567,30") # color=red text={src1}"
- "gal; point 12:34:56.7 +12:34:56.7 # point=cross"
- "annulus 12h34m56.7s, +12d34m56.7s, 30", 1.2' # width=2"
- "box 12.34567, -12.34567, 0.2d, 0.1d"
- The name of an ASCII file containing a list of target descriptions e.g. "srclist.txt".
The file must contain a list of source coordinates, given one per line,
each in one of the formats described above.
- The name of a FITS file containing a standard eSASS
'CATPREP' format target catalogue e.g. "srclist.fits".
The following columns must be present:
- RA - assumed to be in decimal degrees, (ICRS)
- DEC - assumed to be in decimal degrees, (ICRS)
- ID_SRC - assumed to encode the integer id number to be used for forming the filenames of source-specific data products
-
prefix (string) OPTIONAL [e.g. "source_products/test1_"]
- Output filename stem - all output filenames will be prefixed by this string.
New directories will be created where necessary. If srctool is being run in pipeline mode,
then the second character of the filename part of the prefix will be replaced by an
appropriate ownership character if it is a "b" here.
-
suffix (string) OPTIONAL [e.g. "_v1p5_01022015.fits.gz"]
- Output filename suffix - all output filenames appended with this string. If suffix contains no filename extension (does not contain a "."), then ".fits" is also appended to the filename.
-
todo (string array) OPTIONAL [e.g. "ALL"]
- A (space separated) list of operations to be carried out for each target. Valid options are:
- "SPEC" - extract and write source and background spectra for each source
- "LC" - extract and write source and background light-curves for each source
- "EVENTS" - extract and write source and background eventfiles for each source. Please note that the output event files are not suitable as inputs for SRCTOOL or EVTOOL as they lack critical information.
- "ARF" - calculate and write ancillary response files for each source
- "RMF" - calculate and write weighted redistribution matrix files for each source
- "LCCORR" - calculate and write fractional response corrections for the light-curves
- "SRCGTI" - calculate good time intervals based on when each source falls within the live area of at least one eROSITA detector (this option is enabled by default)
- "NOSRCGTI" - inverse of SRCGTI option; assume that the supplied GTIs are valid
- "ALL" - carry out the SRCGTI, SPEC, LC, EVENTS, ARF, RMF, and LCCORR operations
-
insts[...] (integer array) OPTIONAL [e.g. "1 2 3 4 5 6 7"]
- A (space separated) list indicating which of the indices of the seven eROSITA telescopes/instruments that
should be considered in the analysis.
-
srcreg (string) OPTIONAL [e.g. "icrs; circle 12:34:56.7 +12:34:56.7 0.01d"]
- A description of the source extraction region. Valid options are:
-
A single line giving a single region component description, preceded by an optional coordinate system code.
Valid region components are:
- circle long0 lat0 radius[unit]
- annulus long0 lat0 radius1[unit] radius2[unit]
- ellipse long0 lat0 semimajor[unit] semiminor[unit] angle[unit]
- ellannulus long0 lat0 semimajor1[unit] semiminor1[unit] semimajor2[unit] semiminor2[unit] angle1[unit] angle2[unit]
- box long0 lat0 width[unit] height[unit] angle[unit]
- rectangle long1 long2 lat1 lat2
- mask mask_image.fits
When a 'long0' or 'lat0' parameter is given as a "*" wild-card,
then it will be replaced with the corresponding source coordinate.
The valid coordinate system codes are: "icrs", "fk5", "fk4", "gal", "ecl", "j2000", "b1950",
and must be separated from the region component with a semi-colon ";"
When the coordinate system code is omitted, we assume "icrs".
All region parameters are compulsory.
Angles are measured East of North in the region's native coordinate system.
Note that in order to interpret the 'ellipse', 'ellannulus' and 'box' regions, SRCTOOL
must make a local tangent-plane projection, and so
selections using these region types are accurate only for small (compared to the sphere) region extents.
✱ Special case: In order to be consistent with SAO/DS9 regions,
when an ellipse region is specified with 7 parameters, then
it is interpreted by SRCTOOL as an elliptical annulus having angle1=angle2 ✱
Valid size/angle units are:
- " or s - arcseconds
- ' or m - arcminutes
- d - degrees
- r - radians
If unspecified then the size/angle unit is assumed to be degrees.
The mask region type is a special component which allows a FITS image to specify valid
regions. Events landing in positive pixels are included, while those in zero or negative are not included.
The FITS image should have a coordinate system described in the extmap parameter.
-
The filename of an ASCII file containing region descriptions for one or more targets.
The region descriptions for each target MUST be separated by at least one blank line.
Compound regions can be specified by supplying several region components (one per line) for each target.
If a "-" symbol is given before the region component name (e.g. "-circle") then this region
component is subtracted from the composite.
Note that from SRCTOOL v1.20 onwards, lines in region files starting "global" are silently ignored.
This allows SRCTOOL to handle the raw region files written by SAO/DS9.
The valid combinations of source coordinate and region descriptions are as follows:
- A single source coordinate and a single source region
- A catalogue of N source coordinates and a single source region to be used for all sources
(with or without wild-card symbols)
- A catalogue of N source coordinates and a catalogue of N source regions
-
backreg (string) OPTIONAL [e.g. "icrs; annulus 12:34:56.7 +12:34:56.7 0.02d 0.04d "]
- A description of the background extraction region. See srcreg description above.
- An additional option, "NONE", is allowed for the "backreg" parameter, in which case no background
products are extracted by SRCTOOL.
-
exttype (string) OPTIONAL [e.g. "POINT"]
- Description of the source extent model. Used for effective area calculations.
- Valid options are:
-
POINT
- treat the the target(s) as point source(s)
-
GAUSSIAN
- assume a (monochromatic) circular 2D Gaussian profile, cutoff at radius Nσ:
ρ(r/σ ≤ Nσ) ∝ exp(–r2/2σ2)
ρ(r/σ > Nσ) = 0
-
BETA
- assume a (monochromatic) circular Beta-model profile, cutoff at radius NRc:
ρ(r/Rc ≤ NRc) ∝ [1 + (r/Rc)2]–3/2
ρ(r/Rc > NRc) = 0
-
TOPHAT
- assume a (monochromatic) circular tophat profile with radius R
ρ(r ≤ R) = const
ρ(r > R) = 0
-
MAP
- assume that the spatial distribution of the source flux is described in a separate user-supplied image file (see extmap parameter below)
✱ Note that the exttype parameter is ignored when the srccoord parameter gives a CATPREP format catalogue file. In that case a point source is model is used if ext=0 and a beta model is used if ext>0.
-
extpars (real string array) OPTIONAL [e.g. "10.0 3"]
-
A (space separated) list of parameters controlling the source extent handling method.
The meaning of these parameters depends on the value of the exttype parameter:
-
if exttype=POINT
- then ignore extpars
-
if exttype=GAUSSIAN then
extpars[1] = σ (units: arcsec),
extpars[2] = Nσ(cut-off radius, units: number of σ)
-
if exttype=BETA then
extpars[1] = Rc (units: arcsec),
extpars[2] = NRc(cut-off radius, units: number of Rc)
-
if exttype=TOPHAT then
extpars[1] = R (units: arcsec)
-
if exttype=MAP then
extpars[*] = TBD (maybe could use this to override WCS in map?)
✱ Note that the extpars parameter is ignored when the srccoord parameter gives a CATPREP catalogue file.
- extmap
(string) OPTIONAL [e.g. "source_map.fits"]
- A parameter which gives the filename of an image describing the spatial distribution of source flux.
- This parameter is only meaningful when exttype=MAP
- This source map file describes the expected (relative) spatial distribution of X-ray flux from the source.
- The file must be in FITS image format, if no extension is specified then the first valid image extension will be used.
- The FITS header of the source map file must include a set of valid celestial World Coordinate System keywords
(contrast with XMM-SASS arfgen which expects images in detector coordinates)
- See Greisen & Calabretta (2002)
- NAXIS - Keyword giving the number of axes of the image - must equal 2
- NAXIS[1,2] - Keywords giving the number of pixels in each image axis
- CRPIX[1,2] - Keywords giving the reference pixel for each image axis
- Keywords describing the linear transformation matrix that converts from pixel coordinates to an intermediate world coordinate system. Choose one of the following conventions:
- PC[1,2]_[1,2] and CDELT[1,2]
- or CD[1,2]_[1,2]
- Note that use of the deprecated CROTAi keyword is not supported by SRCTOOL
- CTYPE[1,2] - Keywords describing the type of projection along each world coordinate axis
- CRVAL[1,2] - Keywords giving the WCS coordinate at the reference pixel for each image axis
- CUNIT[1,2] - Keywords describing the physical unit of each world coordinate axis
- Allowed projection types are: 'TAN', 'SIN', ...
✱ Note that the extmap parameter is ignored when the srccoord parameter gives a CATPREP catalogue file.
✱ Note that when using a map to describe source extent, the PSF corrections must be turned off (i.e. psftype=NONE).
-
lctype (string) OPTIONAL [e.g. "REGULAR"]
- A string which instructs the task how it should bin the light-curve.
Valid options are:
-
REGULAR
- bin the light-curve with regularly spaced bins and explicitly list all empty bins
- Warning. When used with survey observations, this option can result in light-curves containing many many empty bins
-
REGULAR+
- bin the light-curve with regularly spaced bins, but merge consecutive empty bins (i.e. those having zero fractional exposure)
-
REGULAR-
- bin the light-curve with regularly spaced bins and discard any empty bins (i.e. those having zero fractional exposure)
-
GTI
- bin the light-curve with one time bin per input GTI
-
SRCGTI
- bin the light-curve with one time bin per source GTI (i.e. valid times when the source was within the FoV) and explicitly list empty intervals between valid bins
-
SRCGTI-
- bin the light-curve with one time bin per source GTI (i.e. valid times when the source was within the FoV) and discard any empty bins
-
lcpars (real array) OPTIONAL [e.g. "100 0.0 10000.0"]
- A (space separated) list of parameters controlling the light-curve binning method.
The meaning of these light-curve binning params depend on the value of the lcytpe parameter.
-
lcemin (real array) OPTIONAL [e.g. "0.5 2.0"]
- A (space separated) list of light-curve energy band ranges: a list giving the minimum energy bound for each energy band to consider
- Units keV
- Must have exactly the same number of entries as lcemax[...] (see below)
-
lcemax (real array) OPTIONAL [e.g. "2.0 10.0"]
- A (space separated) list of light-curve energy band ranges: a list giving the minimum energy bound for each energy band to consider
- Units keV
- Must have exactly the same number of entries as lcemin[...] (see above)
-
lcgamma (real) OPTIONAL [e.g. "1.9"]
- This parameter gives the photon index of the nominal power-law spectrum that will be
used to determine the weighting as a function of energy
across the light-curve energy bands, which is necessary when calculating
the mean fractional response in each light-curve time bin.
We assume a simple power law spectrum F(E) = A.E-lcgamma,
where E is the photon energy, A is a normalising constant,
and F(E) is the photon flux (in photons s-1 cm-2 keV-1).
-
tstep (real) OPTIONAL [e.g. "0.1"]
- Accuracy parameter: This is time step that will be used when recalculating
the source coordinates and extraction regions on the detector focal plane (seconds).
Supplying a small value (<<1s) for this parameter means more accurate tracking of the spacecraft pointing, and hence better
fidelity of the outputs, but results in a longer processing time.
✱ Note. Processing time scales approximately as tstep-1 ✱
-
xgrid (real array) OPTIONAL [e.g. "0.25 1.0"]
- A list of spatial accuracy control parameters:
This parameter will be multiplied by the eROSITA physical pixel scale (~8arcsec) to give the
size of the linear spatial sampling that will be used when calculating the fractional response.
Supplying a small value (<<1) for this parameter results in a large number of spatial sampling points,
and hence better accuracy, but requires a longer processing time.
If the user specifies two values for the xgrid parameter, then the first controls the spatial sampling
within the source extraction region, and the second controls the sampling within the background region
(where coarser sampling will typically be acceptable).
If only one value is supplied then the same sampling is used for source and background regions.
✱ Note. Processing time scales approximately as xgrid-2 ✱
-
gtitype (string) OPTIONAL [e.g. "GTI"]
- A string which instructs the task which variety of GTI extension to look for in the eventfiles files.
Valid options are:
-
GTI
- Look for fits extensions called GTI or GTIn
-
QUALGTI
- Look for fits extensions called QUALGTI or QUALGTIn
-
FLAREGTI
- Look for fits extensions called FLAREGTI or FLAREGTIn
-
psftype (string) OPTIONAL [e.g. "2D_PSF"]
- A string which instructs the task type of PSF model to use.
Valid options are:
-
NONE
- Do not apply any PSF corrections (i.e. PSF is assumed to be a delta function)
-
2D_PSF or 2D or MAP
- Use the 'small maps' (XMM-Newton style) PSF description
-
SHAPELET
- Use the shapelet-encoded PSF description
This option is not yet implemented
Note that the parameters of the PSF descriptions are read from the corresponding eROSITA CALDB entries.
-
pat_sel (integer) OPTIONAL [e.g. "1"]
- An integer representation of a bitmask specifying which event patterns should be included. Please see
here for details of the bits. This is combined with the input PAT_SEL keyword with a logical AND (unless the input is 0). The default is 15 (i.e. all valid patterns).
-
flagsel (integer) OPTIONAL [e.g. "31"]
- An integer representation of a bitmask specifying which event FLAGs should be rejected. Please see
here for details of the bits. This is combined with the input FLAGSEL keyword with a logical OR. The default is 0 (no further selection).
-
continue_on_error (Boolean) OPTIONAL [e.g. "yes"]
- If this parameter is set to "yes" (default is "no"), then continue to process sources even if a serious error occurs. Please note that parameter may mask problems, so consider this parameter only if needed. Please report any unexpected errors in SRCTOOL before using parameter.
-
clobber (Boolean) OPTIONAL [e.g. "yes"]
- If this parameter is set to "yes" then any pre-existing output files will be overwritten.
Input files
- eventlist files ("eventfiles" input parameter)
One or more input eventlist files must be supplied to the task.
These files, in FITS format, must contain calibrated
event lists from one or more of the seven eROSITA telescopes. The
eventfiles are specified in FITS binary table extensions, with a
format following that specified in the eROSITA eventfile format
document.
In addition to lists of events, the eventfiles should also contain
meta-data stored in additional FITS binary table extensions. The
expected meta-data are as follows:
-
GTI extensions
- time series describing the good time intervals during the observations
-
BADPIX extensions
- listings of the bad pixels in the detector
-
DEADCOR extensions
- time series describing the fractional on-time of the detectors during the observations
-
CORRATT extensions
- time series describing the spacecraft orientation w.r.t. the celestial frame
These meta-data are associated with the appropriate eROSITA
instrument as follows. Firstly, the "EXTNAME" keyword of each
FITS extension of the eventfile is queried to see if it matches
a valid pattern. Valid values are one of "GTIn", "QUALGTIn", "FLAREGTIn", "BADPIXn",
"DEADCORn", or "CORRATTn", where "n" is a single digit integer
(1-7) indicating the index of the eROSITA instrument to which
the meta-data applies. If "n" is not given (i.e. is a blank), then the
task attempts to read and interpret the "INSTRUME" header keyword,
which must have one of the following values:
"TM1","TM2",...,"TM7", where the last digit gives the index "n"
and treated in the same way as the "n" from before.
SRCTOOL can read in up to 12 eventfiles, each containing a single "EVENTS" extension
listing events collected by one to seven eROSITA telescope modules.
A single "EVENTS" extension can only contain events that have been obtained through the same type of X-ray filter,
i.e. the single FILTER keyword must correctly describe the filter wheel position for all collected events in that extension.
Currently, SRCTOOL cannot handle cases where the set of input eventlists contains events having
more than one filter setting per eROSITA telescope module.
Here are some example combinations of eventfiles and FILTER keywords that are permitted/forbidden :
- Permitted file #1: TM1, filter=A
- Permitted file #1: TM1-7, filter=A
- Permitted file #1: TM1, filter=A, file #2: TM1, filter=A, ..., file #12: TM1, filter=A
- Permitted file #1: TM1, filter=A, file #2: TM2, filter=A
- Permitted file #1: TM1, filter=A, file #2: TM2, filter=B
- Permitted file #1: TM1-5, filter=A, file #2: TM6-7, filter=B
- Permitted file #1: TM1-5, filter=A, file #2: TM6-7, filter=B, file #3: TM6-7, filter=B
- Forbidden file #1: TM1, filter=A+B
- Forbidden file #1: TM1, filter=A, file #2: TM1, filter=B
- Forbidden file #1: TM1, filter=A, file #2: TM4, filter=A, file #3: TM4, filter=B
- Forbidden file #1: TM1-6, filter=A, file #2: TM4-7, filter=B
- Forbidden file #1: TM1-5, filter=A, file #2: TM6-7, filter=B, file #3: TM3-6, filter=B
If the user has eventfiles which do not satisfy these criteria, then the
EVTOOL task can be used to e.g. merge multiple eventfiles into a format suitable for SRCTOOL.
- srccoord file
- srcreg and backreg files
- PSF description file(s)
We expect that SRCTOOL will eventually support several methods to describe the instrumental PSF.
However, only the "small-maps" representation is currently supported, the expected file format of which is described
here.
- Vignetting description file(s)
SRCTOOL uses a parametrized vignetting model read from the CALDB.
- Bad pixel description file(s)
- Reference ARF file(s)
SRCTOOL expects reference ARF files which follow the
OGIP standards.
- DETMAP, INSTPAR, PATTCAL, REFRMF, EBOUNDS files
These calibration files are automatically read from the CALDB.
Output files
When requested in the
todo parameter, one of each of the
following output file types is produced for each source specified
by
srccoord, and for each instrument specified
in
insts. An additional 'total' output, summed or averaged
across the (up to) seven
eROSITA telescope modules is also produced for each
source.
The file naming system follows the
standard eROSITA conventions.
Spectrum file(s)
Standard PHA style files for use with XSPEC or your favourite X-ray fitting tools.
The format of these files follows the OGIP recommendations for spectral analysis files described
here.
Please note that the BACKSCAL keyword written by SRCTOOL is the average area in square degrees of the intersection of the source region with the detector during the source-specific GTI (unless NOSRCGTI is used).
This means that BACSKCAL can be significantly less than the geometric area of the extraction region during scans or the survey.
The full geometric area of the region is written (in version 1.63+) as the non-standard keyword REGAREA, and the intersection of the region where the source model is non-zero with the region is written as RGMDAREA (note that this is zero for background spectra).
The accuracy to which BACKSCAL, REGAREA and RGMDAREA is calculated depends on the xgrid parameter.
The EXPOSURE keyword of the spectrum is given by the total time the source is on a detector (providing NOSRCGTI is not used), after deadtime corrections.
Light-curve file(s)
These files give the binned X-ray light-curve for the source in several energy bands.
The format of these files follows the OGIP recommendations for timing analysis data files described
here.
Detailed description of content
1 | TIME | D | s |
Time at mid-point of bin. See MJDREF,TIMEZERO,TIMEUNIT,TIMESYS header keywords |
2 | TIMEDEL | D | s |
Width of time bin |
3 | COUNTS | nJ | count |
Number of counts detected in the source extraction region for each energy band (not background subtracted). |
4 | RATE† | nE | ct s-1 |
Net corrected count rate of the source for each energy band.
Calculated as RATE[i]=(COUNTS[i]-BACK_COUNTS[i]·BACKRATIO)/(FRACEXP[i]·TIMEDEL) |
5 | RATE_ERR† | nE | ct s-1 |
The 1σ uncertainty on the RATE column for each energy band.
This is computed by adding in quadrature the uncertainties on the counts in the source region (σSi) and the background region (σBi).
It is only calculated if the total counts in source and background exceeds 25, to ensure that the uncertainty is reasonably accurate. If the counts are less than this nan is used instead.
Specifically RATE_ERR[i] = √(σSi2 + σBi2·BACKRATIO)/(FRACEXP[i]·TIMEDEL),
where the sigmas are computed using the sqrt(N) approximation.
|
6 | BACK_COUNTS | nE | count |
Number of counts detected in the background extraction region for each energy band. |
7 | FRACAREA† | nE | unitless ratio |
The fraction of the nominal on-axis effective telescope collecting area that was seen by the source, computed for each energy band.
Dividing by this factor corrects for the telescope vignetting function, any bad pixels, the boundary of the instrumental FoV, and the
flux lost outside the source extraction aperture due to the finite size
of the convolution of the source extent with the instantaneous telescope PSF (when PSF loss calculations are enabled).
|
8 | FRACTIME† | E | unitless ratio |
The fraction of the time bin which overlaps with input GTIs and for which at least some part of the source extraction region overlapped with the instrumental FoV.
Dividing by this factor corrects for any incomplete temporal coverage of the light-curve bin.
|
9 | FRACEXP† | nE | unitless ratio |
The product of the fractional collecting area and the fractional temporal coverage, i.e. FRACEXP[i] = FRACAREA[i] · FRACTIME
|
10 | OFFAXIS† | E | deg |
The mean off-axis angle of the source during this time bin.
|
11 | BACKRATIO† | D | unitless ratio |
The factor by which the background counts should be scaled in order to estimate the number of background counts within the source aperture.
|
Note that "n" is equal to the number of energy bands requested (see lcemin, lcemax) .
Note that the light-curve columns marked with † are only computed if option LCCORR is selected in the "todo" parameter.
In the case of the combined lightcurve, we sum the values form the individual telescope modules to calculate COUNTS and BACK_COUNTS. The mean value of the active TMs is used to calculate FRACAREA, FRACTIME, FRACEXP, OFFAXIS and BACKRATIO. RATE and RATE_ERR are recalculate using the above formula.
RMF file(s)
These files contain the effective redistribution matrix for each source, to be used alongside the spectrum files for spectral analysis.
The format of these files follows the OGIP recommendations for redistribution matrix FITS files described
here.
ARF file(s)
These files contain the effective area curves for each source, to be used alongside the spectrum files for spectral analysis.
The format of these files follows the OGIP recommendations for effective area FITS files described
here.
In addition to the standard columns, the SPECRESP table includes the corrections applied to the standard on-axis effective area due to vignetting and PSF losses.
CORRCOMB is the total correction factor (1.0 if no correction).
The two subcomponents of this are the vignetting (CORRVIGN) and the PSF (CORRPSF) corrections.
Note that the total correction factor is summed separately to the subcomponents; CORRCOMB is not necessarily CORRPSF multiplied by CORRVIGN.
The ARF contains corrections for when the source is only partially on a detector during the GTIs, as calculated by the source model, PSF (if PSF correction is used) and the extraction region.
Therefore, for a scanning observation, as the source size increases the effective area in the ARF will decrease.
Fitting an extracted spectrum should yield the total properties of the source in the extraction region, providing the source model is accurate.
Event file(s)
These files contain a subset of the input events, namely those falling in the source and background regions.
They are missing critical information from the input eventfiles (e.g. bad pixels and attitude) and therefore cannot be used for further analysis in SRCTOOL or EVTOOL; they are mostly intended for checking the output of SRCTOOL or for display.
Source GTI extension(s)
When one or both of the todo="ARF" or "LCCORR" options are selected, then SRCTOOL will calculate "source" GTIs,
i.e. a list of good time intervals when at least some fraction of the source
extraction region falls on an active part of an eROSITA detector (and when all other GTI constraints are also met).
An independent source GTI is calculated for each of the seven eROSITA instruments.
Events falling in the source and background regions are filtered by the source GTIs before spectra
and light-curves are accumulated.
The source GTIs will be appended (as fits extensions) to the output spectra, light-curve and eventlist files.
Installation and operation
-
Some compute-intensive sections of the SRCTOOL code (most importantly
the calculation of the fractional response) have been parallelised in
order to reduce execution time. In order to enable multi-threaded
operation, SRCTOOL must be compiled with the gcc compiler option
"-fopenmp" turned on. The user can then control the maximum number of
threads allowed at run-time by setting the "OMP_NUM_THREADS"
environment variable. For maximum parallelisation of SRCTOOL, ensure
that OMP_NUM_THREADS >= number of instruments that are to be
considered. The verbosity of the SRCTOOL output can be increased by
setting the environment variable SASS_VERBOSITY to "chatty".
-
Profiling of SRCTOOL on MPE systems has shown that enabling compiler
optimisation (e.g. gcc compiler option "-O2" or "-O3") when building
SRCTOOL can improve execution time by a factor of ~two, therefore, it
is highly recommended that this option be enabled.
Algorithm(s)
Source extraction
The following procedure is adopted when
SRCTOOL is tasked with extracting spectra and/or light-curves.
- Merge input eventlists into one per instrument
Extended source handling
eROSITA is expected to detect hundreds of thousands of extended
sources (mostly galaxy clusters), therefore correct handling of extent
within
SRCTOOL is vital. The following procedures are implemented in
SRCTOOL to handle the calculation of the effective instrumental
response for extended sources.
Compact or very extended sources, which mode to use?
SRCTOOL has two main operational modes when handling extended sources, depending on whether it is instructed to
correct for or to ignore PSF losses (input parameter psftype='2D_PSF' or 'NONE' respectively).
When extracting source products for relatively compact and circularly symmetric extended sources, one should turn on
PSF modelling, since PSF losses are likely to be important. In this mode, SRCTOOL performs
a convolution of the PSF model with the source extent model and uses
this when computing the expected fraction of source light falling
inside the source extraction region. The vignetting of the instrument
is computed at the source centre, and assumed to be constant over the
source extent. Note that these assumptions break down for strongly
non-circularly symmetric sources.
For very extended, and or asymmetric sources, PSF losses are
unimportant and one should turn off PSF modelling. In this mode, the
vignetting function is computed across the full source extent.
Both modes depend on the user giving SRCTOOL description of the
intrinsic spatial distribution of the source flux.
Handling of very large extended sources (psftype='NONE')
If psftype=NONE, then SRCTOOL does not account for PSF losses, which speeds up the processing of very large sources.
If using this option, it is important to define a source model which describes the morphology of the source over the extraction region (see the exttype parameter); the default point model is not a good choice if psftype=NONE.
A simple flat model can be given using the TOPHAT model.
If using a tophat model, the user may want to set the extent of the tophat to be larger than the extraction region and they should ensure that the source position is correct.
For a more sophisticated source model, the extmap parameter allows a user-supplied source model image.
Please note that by default any background region is extracted using the same GTIs as the source.
If the source region is large, this means that only a limited part of the background region data will appear in the background region outputs.
In addition, an ARF appropriate for the source region is unlikely to be appropriate for the background region if they are large and/or separated.
Therefore, the user is advised to extract large background regions separately and do a joint spectral fit on the source and background spectra.
When modelling spectra, please note that the BACKSCAL includes effects such as loss due to the field of view, which are also included in the ARF effective area.
The appropriate area if modelling using an ARF is likely to be REGAREA (the pure geometric area), whereas if modelling without an ARF (e.g. particle background), BACKSCAL is likely appropriate.
Handling of compact symmetric sources (psftype='2D_PSF')
- Interpret description of source spatial profile.
- The user must supply srctool with a model of each source's
spatial extent: ρe(Δαdeg,Δδdeg).
The spatial extent model can either be expressed as a
parameterised analytic expression (chosen from a short
menu of standard models), or as a 3D image of the relative
intensity of the source emission as a function of photon
energy. In both cases the source geometry must be expressed
in physical coordinates relative to the central position of
the source, and aligned with the Equatorial (J2000)
coordinate grid. The energy dependence of the extent model
is included here for completeness, but is not expected to be
needed in general.
- Where necessary, srctool calculates a (finely) pixelized set
of 2D maps (one per energy bin, e) of the source extent in
equatorial coordinates: ρe(αJ2000,δJ2000)
- The user must also provide a description of the spatial
extraction region from which source photons are selected
(see description below for details). srctool interprets the
description of the region from the user's description, and
distributes a number of evenly spaced sample points within
the region. These sample points are the locations where
srctool samples the instantaneous PSF.
- Convolve source extent model with PSF model.
- In general, we have a PSF model that is expressed as a set
of small 'maps', PSFxi,e, evaluated at discrete energies, e, and
where xi describes a discrete location on the focal
plane (xi=[xpix,ypix] or
xi=[θφ]) where the PSF is evaluated.
- srctool calculates a (finely) pixelized set of convolved 2D
maps (one for each focal plane position xi and energy e)
of the source extent in Equatorial coordinates:
ρ′xi,e(αJ2000,δJ2000)
- This is carried out separated for each of the seven eROSITA telescopes, which in general have different PSFs
- Note that for reasons of computational efficiency, the
convolution of source extent and PSF models is carried out
in Fourier space, using routines from the popular fast
Fourier transform library FFTW.
Specifically, we exploit the relationship:
- 𝔸⊗𝔹 = invFFT[FFT(𝔸)×FFT(𝔹)] ,
where 𝔸 and 𝔹 are real 2D matrices, ⊗ is the convolution operator,
FFT(),invFFT() represent the Fast Fourier Transform and its inverse, and ×
represents element-by-element multiplication of the (complex) matrix elements.
- Step through the valid GTIs, carrying out the following for each time step:
- Calculate the instantaneous centre and roll angle of the
telescope
- Calculate the location of the centre of the source, xnow,
and locations of sample points on the focal plane.
- Measure the detector map/bad pixel map at the sample points.
- Interpolate ρ′xnow,e from the
ρ′xi,e that are closest
to the current source location on the focal plane.
- Compute the weighted sum ΣV(xnow,e).ρ′xnow,e over
all sample points, after carrying out a rotation and
translation of the sample points into the PSF map to model
the instantaneous alignment of the PSF on the sky. Where
V(xnow,e) is the energy dependent vignetting function.
- Add result of e., weighted by the live time interval, to the running total.
Note that the fully correct process to calculate the instantaneous
image of the source on the detector (close to the behaviour of photons
in eROSITA itself) would be to first multiply the intrinsic source
profile by the vignetting function and then to convolve the result by
the PSF. However, for the sake of computational efficiency we make the
simplifying assumption that the vignetting is uniform across the source extent,
and only compute the instantaneous vignetting at the source centre.
We also assume that the extent of the source is
small relative to the rate at which the PSF model changes as a
function of position within the focal plane.
This is likely to be a reasonable assumption because very large
extended sources which do not meet this criterion are likely to be
analysed with the PSF model turned off (because the fraction of the
total photons that are lost outside the extraction aperture due to PSF
broadening is very small).
At high off-axis angles the PSF of eROSITA is much more elongated in
the azimuthal direction than in the radial direction. The PSF shape
varies strongly with off-axis angle, but slowly with azimuthal angle
within the focal plane. The orientation of the PSF relative to the
source profile and extraction region depends on the location within
the focal plane. This effect is unimportant in cases where the source
and extraction region are rotationally invariant. That is, either
point-like sources or source with spatial profiles which have no
azimuthal dependence, and extraction regions that are either circles
or annuli centred on the source position. The vast majority of
extended eROSITA sources will be faint, and so only a simple
rotationally symmetric profile will be fitted. We have optimised the
extended source handling within srctool to accommodate this case.
Hence, for reasons of computational efficiency, we initially convolve
the PSF and source profile over a finite grid of locations within the
focal plane, and then when necessary rotate our sample points into
these ρ′xnow,e
using the appropriate instantaneous azimuthal angle.
Automatic generation of extraction regions
When the
srcreg and/or
backreg parameters are set to "AUTO" and the
source description in
srccoord is supplied as a
CATPREP
catalogue, then
SRCTOOL will build the source and/or background
regions automatically. Source regions are circles and the background
regions are annuli, both centred on the best fitting source
coordinates (RA,DEC columns). To determine the appropriate sizes of
these regions,
SRCTOOL takes account of the fitted number of source
counts (ML_CTS_0 column), the level of the background map model at the
source position (ML_BKG_0 column), the best fitting source extent model
radius (from the EXT column), together with a model of the effective
eROSITA PSF at the source position (averaged over the integration, and
summed over all operating telescope modules). Given these source,
background and PSF parameters, the following algorithm is used to
determine the most appropriate sizes for the source and background
regions:
There are a number of hard-coded parameters associated with the AUTO
computation algorithm (marked with † symbols), and are given in
the table below.
Auto-region parameters
PSF energy |
1.0 |
keV |
PSF_ENERGY_KEV |
Radial step size (source) |
1.0 |
arcsec |
RADIAL_STEPSIZE_SRC |
Radial step size (background) |
2.0 |
arcsec |
RADIAL_STEPSIZE_BACK |
Minimum source inclusion radius |
15.0 |
arcsec |
MINIMUM_SOURCE_RADIUS |
Minimum source exclusion region radius. Must be smaller than the minimum exclusion distance. |
5.0 |
arcsec |
MINIMUM_EXCLUDE_RADIUS |
Minimum core radius of source, used when excluding regions from overlapping sources |
5.0 |
arcsec |
MINIMUM_SOURCE_CORE |
Minimum exclusion distance. No exclusion zones are allowed to be centred within this radius from the source. |
10.0 |
arcsec |
MINIMUM_EXCLUDE_DIST |
Initial source radius to background inner radius ratio |
2.0 |
ratio |
INITIAL_SRC_R_TO_BACK_R1 |
Maximum local (surface brightness) contamination of a source's background region by its own PSF wings |
5% |
ratio |
MAX_SRC_MAP_TO_BG_MAP_RATIO |
Initial ratio of the geometric area of the background region to the source extraction region |
10 |
ratio |
BACK_TO_SRC_AREA_RATIO |
Maximum local (surface brightness) contamination of a source extraction region by a confusing source |
20% |
ratio |
MAX_CONF_MAP_TO_SRC_MAP_RATIO |
Maximum local (surface brightness) contamination of a background extraction region by a confusing source |
10% |
ratio |
MAX_CONF_MAP_TO_BACK_MAP_RATIO |
Maximum inner radius of background annulus as a multiple of the local effective PSF 99% containment radius |
3 |
ratio |
MAX_RATIO_BACK_R1_TO_RADIUS_99PC |
Maximum difference between inner and outer radii of background annuli |
120 |
arcsec |
MAX_BACK_ANNULUS_WIDTH |
Although it is not recommended except in the case of optimising this
tool, these parameters values can be overridden in environment
variables with names given in the table above prefixed by
SRCTOOL_AUTOREG_. For example, setting SRCTOOL_AUTOREG_PSF_ENERGY_KEV
with the value 2.0 will change the PSF energy to 2 keV.
Compute size of source extraction circle
- Inclusion policy for source regions:
- Include region around each source which maximises the nominal SNR
given the local background surface brightness and the surface
brightness profile of the PSF wings.
- Clip to some minimum (15† arcsec) and maximum (99% EEF radius) radii.
- Use an effective REEF (Radial Encircled Energy Function) to determine the optimal radius:
- for Survey mode observations we use an internally computed survey-averaged PSF model
- for Pointing mode observations we use the PSF model that is nearest to the mean off-axis angle of the source
- for point sources use the REEF of the effective PSF
- for extended sources first convolve the source model and the PSF, then compute REEF
- Detailed Algorithm:
- 1) read columns from CATPREP catalogue: ID_SRC, RA, DEC, ML_CTS_0, ML_BKG_0, EXT
- ML_CTS_0 gives the best fitting background subtracted source counts, corrected for aperture
losses, but not corrected for the effects of vignetting.
- the ML_BKG_0 column is expected to be given in units of: cts arcmin-2
- 2) search for a radius ri (in deg) which maximises the expected SNR:
- while (SNRi+1 > SNRi) {ri+1 = ri + δr} ,
- where:
- SNRi = SCTSeff(ri) / sqrt[BCTSeff(ri) + SCTSeff(ri)]
- SCTSeff(ri) = ML_CTS_0 · REEF(ri)
- BCTSeff(ri) = ML_BKG_0 · 602 · π · ri2
- REEF(ri) is a measure of the PSF, and gives the fraction of energy enclosed within a radius ri
Compute size of background extraction annulus
-
Inclusion policy for background regions:
- Annulus centred on source position with radii {rback,1, rback,2}
- The inner radius, rback,1, is set such that the surface brightness of
the target source's PSF wings is less than 2%† of the local
background surface brightness
- The outer radius, rback,2 is then scaled such that area is
10† times that within the nominal source extraction
region.
- A maximum width of 120 arcsec is placed on the width (difference between inner and outer radii) of the background region.
- The outer radius is increased if there are confusing outer sources in the region to get the same 10 ratio in area between the source and background.
If the width of the annulus goes beyond the limit (120), then it is still increased until the source and background have the the same area.
Compute regions to exclude around potentially confusing neighbouring sources
Nearby X-ray sources could potentially contaminate both the source and background spectra.
To minimise the effects of such "confusing" sources, we exclude regions
around each potentially contaminating source
from the target source and background extraction regions.
-
Exclusion policy for removing contamination from source extraction regions:
- Exclude region around each confusing source out to a radius where the surface
brightness of the PSF wings of the confusing source is greater than 20%† of the
local target source surface brightness.
- Clip to some minimum (5† arcsec) and maximum (99% EEF radius) radii.
- Use RPSF of effective PSF to compute radii.
- Compare surface brightnesses along the line joining the two sources.
-
Exclusion policy for removing contamination from background extraction regions:
- Exclude region around each confusing source out to a radius where the surface
brightness of the PSF wings of the confusing source is greater than 10%† of the
local background surface brightness.
- Clip to some minimum (5† arcsec) and maximum (99% EEF radius) radii.
- Use RPSF of effective PSF to compute radii.
Examples of usage
Note that the data files mentioned in the examples below are distributed with the
eSASS software, and can be found in the $SASS_TESTDATA directory.
Example 1
Extract the spectrum and 20s binned light-curves
(0.5-2 and 2.0-10 keV bands), and calculate the RMF, ARF and light-curve
corrections for a point source located at 01:23:45.67,+01:23:45.67
(J2000), using a setup that is appropriate for data collected in the
all-sky survey. Extract data from all
eROSITA telescope modules (TM1..7).
Extract source counts from a 60" radius circle and background from an
annular region centred on the source position. Calculate ARF corrections
for photons lost outside the source aperture using the standard 2D PSF
model. Do not reject any flagged events. Any existing output files are not overwritten.
srctool eventfiles="test_SURVEY_COMPACT_POINTSRC_eventfile.fits.gz" \
srccoord="icrs;01:23:45.67,+01:23:45.67" \
prefix="srctool_example1/example1_" \
suffix="_v2" \
todo="SPEC ARF RMF LC LCCORR" \
insts="1 2 3 4 5 6 7" \
srcreg='icrs;circle(*,*,60.0")' \
backreg='icrs;annulus(*,*,90.0",120.0")' \
exttype="POINT" \
lctype="REGULAR" \
lcpars="20.0" \
lcemin="0.5 2.0" \
lcemax="2.0 10.0" \
lcgamma="1.7" \
tstep=0.05 \
xgrid="0.5 1.0" \
gtitype="GTI" \
psftype="2D_PSF" \
flagsel=0 \
clobber="no"
Example 2
Extract the spectrum and calculate the RMF and ARF
for a relatively compact symmetric extended source located at 01:23:45.67,+01:23:45.67 (J2000),
using a setup that is appropriate
for data collected in a pointed-mode observation (i.e. attitude changes slowly w.r.t. the tstep param).
Do not calculate new source GTIs (assume that the input GTIs are valid).
Extract data from just the TM1 and TM2
eROSITA telescope modules.
Extract source counts from a 200" radius circle and background
from a circular region offset from the source position.
Model the source extent with a tophat profile, with radius 180".
Reject any flagged events. Any existing output files are overwritten.
srctool eventfiles="test_POINTING_COMPACT_TOPHAT_eventfile.fits.gz" \
srccoord="icrs;01h23m45.67s,+01d23m45.67s" \
prefix="srctool_example2/example2_" \
suffix="_v7" \
todo="SPEC ARF RMF NOSRCGTI" \
insts="1 2" \
srcreg='icrs;circle * * 200.0"' \
backreg='icrs;circle 01:23:45.67,+01:40:00.0,200.0"'\
exttype="TOPHAT" \
extpars="180.0" \
tstep=0.05 \
xgrid="0.5 1.0" \
gtitype="GTI" \
psftype="2D_PSF" \
flagsel=255 \
clobber="yes"
Example 3
Extract source products for objects in a
CATPREP catalogue,
allowing
SRCTOOL to compute the extraction regions automatically.
Compute light-curves for four broad energy bins.
srctool eventfiles="test_SURVEY_CATALOGUE_BETA_eventfile.fits.gz" \
srccoord="test_SURVEY_CATALOGUE_BETA_catprep.fits.gz" \
prefix="srctool_example3/example3_" \
suffix="_autoreg" \
todo="SPEC ARF RMF LC LCCORR" \
insts="1 2 3 4 5 6 7" \
srcreg='AUTO' \
backreg='AUTO'\
lctype="SRCGTI-" \
lcemin="0.5 1.0 2.0 5.0" \
lcemax="1.0 2.0 5.0 10.0" \
lcgamma="1.9" \
tstep=0.05 \
xgrid="1.0 2.0" \
clobber="yes"
Example 4
Extract the spectrum and calculate the RMF and ARF
for a large extended source located at 01:23:45.67,+01:23:45.67 (J2000), using a setup that is appropriate
for data collected in a pointed-mode observation (i.e. attitude changes slowly w.r.t. the tstep param).
Weight the computed response using the supplied source map.
Do not calculate new source GTIs (assume that the input GTIs are valid).
Extract data from just the TM2 and TM5
eROSITA telescope modules.
Extract source counts from a 300" radius circle and background
from a circular region offset from the source position.
Do not apply corrections for PSF losses.
Any existing output files are overwritten.
srctool eventfiles="test_POINTING_VEXTENDED_MAP_eventfile.fits.gz" \
srccoord="icrs;01 23 45.67,+01 23 45.67" \
prefix="srctool_example4/example4_" \
suffix="_v4" \
todo="SPEC ARF RMF NOSRCGTI" \
insts="2 5" \
srcreg='icrs;circle * * 0.25d' \
backreg='icrs;circle 01:23:45.67,+01:46:00.0,300.0"'\
exttype="MAP" \
extmap="test_VEXTENDED_MAP_extentmap.fits.gz" \
tstep=5.0 \
xgrid="2.0 2.0" \
gtitype="GTI" \
psftype="NONE" \
clobber="yes"
Notes
Useful eROSITA parameters (all numbers approximate)
FOV diameter | 1.03 deg |
Focal length | 1.60 m |
Number of telescope modules | 7 |
Detector format | 384•384 pixels |
Pixel size | 75•75μm2 |
Pixel scale | 9.6 arcsec pix-1 |
Plate scale | 7.8 μm arcsec-1 |
Sub-pixel coordinate grid | ~0.064 arcsec |
Photon location accuracy | ~2 arcsec |
Valid event patterns | singles, doubles, triples, quadruples |
Full energy range | 0.1-15.0 keV |
Useful energy range | 0.3-10.0 keV |
Energy resolution | 65eV@1keV, 135eV@6keV (E/ΔE~15-50) |
| |
Typical observing pattern (Ecl. equator) | 6 scans source-1 season-1 |
Total number of 6-month seasons | 8 |
Time for one scan around a great circle | 4 hours |
Nominal scan speed | 90 deg hour-1
1.5 deg min-1
1.5 arcmin s-1
90 arcsec s-1 |
Time for scan to cross full FOV | 41.2 s |
CCD Frame time | 50 ms |
CCD Frame transfer time | 130 μs |
Distance scanned in one CCD frame-time | 4.5 arcsec
0.5 detector pixel |
Cross-scan precession rate
at Ecliptic equator | 360 deg/(365 days•24 hrs/4 hrs)
0.167 deg scan-1
10 arcmin scan-1
600 arcsec scan-1
multiply the above by cos(β) at other Ecliptic latitudes
|
Known issues
- CORRPSF column in ARF file may contain correction factors other than the PSF. Further investigation needed.
- Task can be very slow if xgrid or tstep parameters are not chosen wisely.
- Background subtraction is not correct in combined lightcurve for periods when a different number of TMs are active compared to the full lightcurve (for example due to different GTIs for different TMs). The BACKRATIO includes a contribution from the inactive TM (zero is included in the mean).
- srctool products are expected to be affected by the double counting of the chopper setting, if it is not 1 in the input dataset (see the FAQ). The exposure values in spectra and lightcurves will be scaled by 1/N of the chopper value. This has not yet been confirmed.
- If multiple event files are provided to srctool using the eventfiles= option, and if these event files contain data for the same TMs overlapping within lightcurve time bins, then the lightcurve rates are not calculated correctly within those bins. The recommended work around is to merge the event files with evtool first and pass a single eventfile to srctool.