EP-FXT Science Data Center / Users Guide v2.0 · 2026-11-04

FXTSoft v2.0 documentation

fxtsrcproducts help

Command help for fxtsrcproducts in the FXTSoft v2.0 release.

← Back to Command Reference

NAME

fxtsrcproducts -- Extract source products and prepare response products from a context-aware merged FXT event file.

USAGE

fxtsrcproducts config=fxtsrcproducts.toml
fxtsrcproducts config=fxtsrcproducts.toml resume=yes
fxtsrcproducts evtfile=merged.fits rspctx=response_context.json sources=sources.json outdir=srcproducts
fxtsrcproducts evtfile=merged.fits rspctx=response_context.json sources=sources.json outdir=srcproducts response=no
fxtsrcproducts evtfile=merged.fits rspctx=response_context.json sources=sources.json outdir=srcproducts stack=jointfit

DESCRIPTION

fxtsrcproducts creates spectra, light curves, images, and response products from merged FXT events and their response information. Use a TOML configuration to specify the workflow, or the parameter interface when config=NONE or is omitted. Compatible completed stages can be reused with resume=yes.

The workflow prepares source and background GTIs, extracts products with XSELECT, uses the HEASoft grppha command for optional PHA grouping, generates response products and OGIP metadata, optionally subtracts background light curves, and produces combined or joint-fit deliverables.

FITS PRODUCT METADATA

Generated FITS products use ORIGIN='IHEP/CAS' in every HDU. Real CREATOR and HISTORY records from the processing tools are retained, and CHECKSUM/DATASUM are refreshed after output metadata changes. Input files and unchanged CALDB copies retain their original provenance.

DS9/CIAO REGION INPUTS

The srcregion and bkgregion files use the shared supported DS9/CIAO region parser. A headerless shape whose position contains sexagesimal colons or explicit h/d position units is interpreted as celestial FK5/J2000 for that shape. Explicit fk5, icrs, image, or physical directives retain precedence. Bare numeric positions keep the physical-coordinate default; the parser does not infer sky coordinates from numeric ranges or from a radius unit alone. Inferred celestial circles, annuli, ellipses, and boxes require explicit angular units on every size or axis, and mixed pixel/sky position tokens in one shape are rejected. Exclusions are preserved when the supported signed DS9 form is used. This is a supported subset of CIAO/DS9 syntax, not a general CIAO region-language implementation.

PARAMETER SUMMARY

ParameterDefault / valuesSummary
evtfilerequiredContext-aware merged event file used as the user-facing container
rspctxrequiredResponse context JSON produced from the context-aware event merge
sourcesrequiredJSON source specification: a top-level list or an object with a sources list; each source has srcregion and may have bkgregion
configNONEOptional TOML workflow configuration; NONE keeps the legacy parameter interface
outdirrequiredOutput source-products directory
responseyesRun per-atom RMF/ARF command generation after xselect products (yes/no)
expfilesNONEOptional exposure-map files, comma-separated or @listfile, matched to response atoms
stackautoStack mode: auto, jointfit, combined, or none
fallbackjointfitFallback when response compatibility fails: jointfit or fail
datamodesFF,PWComma-separated modes to process; FF and PW are supported, while TM is skipped
coverage_modeautoSource coverage mode: auto, attitude, exposure, or obs_gti
coverage_tstep1.0Maximum source-coverage attitude sampling step in seconds
coverage_accuracystandardSpatial coverage sampling accuracy: fast, standard, or precise
coverage_grid16Spatial coverage grid samples per axis
coverage_minfrac0.01Minimum valid area fraction for a time sample to enter SRCGTI
coverage_warnfrac0.1Warn when mean valid area fraction is below this value
arf_modeautoARF mode: auto, aspect, exposure, or none
arf_weightaspectAspect ARF weighting mode: aspect or event
arf_thetabin0.05Aspect ARF theta-bin width in arcmin
backscal_policysource_effareaBACKSCAL policy: source_effarea or region_area
background_policylocal_skyBackground policy: local_sky or none
bexpscale1000.0Compatibility parameter accepting only 1000; background exposure is not rescaled
bkgmethodascaBackground combination method: auto, time, asca, counts, or weighted
productsspectrum,curve,imageComma-separated xselect products to extract: spectrum, curve, image
lc_errmethodautoLight-curve error method: auto, input, or gehrels
clobberyesOverwrite existing output files (yes/no)
verbose1Logging verbosity: 0=warning/error, 1=normal info, 2=debug
response_modecontext_mergedResponse mode; context_merged is required for merged events
background_regionautoBackground region mode: auto, manual, or none
bkg_inner_factor2.5Inner radius factor for auto annulus background regions
bkg_outer_factor5.0Outer radius factor for auto annulus background regions
bkg_min_area_ratio5.0Minimum auto-background area divided by source area
lc_binsizes1Comma-separated light-curve bin sizes in seconds; first bin keeps the legacy .lc name
response_kernelxselectExtraction kernel; xselect is used for PHA/LC/image extraction
xspec_smokeyesWrite XSPEC joint-fit smoke-test script (yes/no)
xspec_runnoRun XSPEC smoke test after writing script (yes/no)
xspec_run_modescript_ttyXSPEC run mode: stdin, atscript, or script_tty
subtract_backgroundnoWrite background-subtracted light curves during extraction (yes/no)
group_min_counts0Group spectra to this minimum count threshold; 0 disables grouping
resumenoReuse successful compatible stage manifests and outputs (yes/no)
dryrunnoWrite scripts and manifest without running xselect/response commands (yes/no)
keepintermediateyesKeep rebuildable XSELECT scripts and source/background GTIs (yes/no); dryrun always keeps them
modeqlQuery/learn mode
bkgmethodascaBackground combination method: auto, time, asca, counts, or weighted
lc_errmethodautoLight-curve error method: auto, input, or gehrels

PARAMETERS

evtfile
Context-aware merged event file used as the user-facing container. Required.
rspctx
Response context JSON produced by the context-aware event merge. Required.
sources
JSON source specification as a top-level list or an object with a sources list. Each source should provide srcregion and may provide bkgregion. Required.
config
Optional TOML workflow configuration. When supplied, only outdir, resume, dryrun, clobber, and verbose may override TOML values on the command line. Default: NONE.
outdir
Output source-products directory. Required.
response
Run per-atom RMF/ARF command generation after xselect products. Default: yes.
expfiles
Optional exposure-map files, comma-separated or @listfile, matched in response-atom order. Paths may contain spaces; use one complete path per list-file line or a quoted string for each TOML array entry. Default: NONE.
stack
Stack mode: auto, jointfit, combined, or none. Default: auto.
fallback
Fallback when response compatibility fails: jointfit or fail. Default: jointfit.
datamodes
Comma-separated datamodes to process. Default: FF,PW.
coverage_mode
Source coverage mode: auto, attitude, exposure, or obs_gti. Default: auto.
coverage_tstep
Maximum source-coverage attitude sampling step in seconds. Default: 1.0.
coverage_accuracy
Spatial coverage sampling accuracy: fast, standard, or precise. Default: standard.
coverage_grid
Spatial coverage grid samples per axis. Default: 16.
coverage_minfrac
Minimum valid area fraction for a time sample to enter SRCGTI. Default: 0.01.
coverage_warnfrac
Warn when mean valid area fraction is below this value. Default: 0.10.
arf_mode
ARF mode: auto, aspect, exposure, or none. Default: auto.
arf_weight
Aspect ARF weighting mode: aspect or event. Default: aspect.
arf_thetabin
Aspect ARF theta-bin width in arcmin. Default: 0.05.
backscal_policy
BACKSCAL policy: source_effarea or region_area. Default: source_effarea.
background_policy
Background policy: local_sky or none. Default: local_sky.
bexpscale
Only 1000.0 is accepted for compatibility with older configurations; other values are rejected. This value does not change combined products. The fxtspecmerge backend retains floating background counts and propagates their variance without an artificial exposure multiplier.
bkgmethod
Background combination method passed to fxtspecmerge. auto selects time for measured Poisson backgrounds, counts for effective-Poisson remerges, and weighted for model backgrounds. Explicit choices are time, asca, counts, and weighted. The value is case-insensitive. Default: asca, matching CIAO.
products
Comma-separated xselect products to extract: spectrum, curve, and image. Default: spectrum,curve,image.
lc_errmethod
Light-curve error method. auto (default) uses Gehrels errors for source and background when the native curve provides trusted integer counts and exposure information; otherwise it retains the input ERROR column and emits a warning. input always retains the native ERROR values. gehrels requires the trusted count/exposure information and fails when it is unavailable.
subtract_background
Write net light curves during extraction using the prepared scaling metadata. Default: no.
group_min_counts
When greater than zero, group extracted spectra with the HEASoft grppha command using group min N. Default: 0.
resume
Reuse successful manifests only when their configuration fingerprints and declared outputs still match. Default: no.
clobber
Overwrite existing output files. Default: yes.

EXAMPLES

fxtsrcproducts config=fxtsrcproducts.toml
fxtsrcproducts config=fxtsrcproducts.toml outdir=rerun resume=yes
fxtsrcproducts evtfile=merged.fits rspctx=response_context.json sources=sources.json outdir=srcproducts
fxtsrcproducts evtfile=merged.fits rspctx=response_context.json sources=sources.json outdir=srcproducts stack=combined fallback=jointfit

LIGHT-CURVE ERROR CONTRACT

Native XSELECT light curves carry the original integer COUNTS and per-bin LIVETIME in seconds. The generated curves record CNTSTAT='POISSON', CNTMETH='XSELECT', and LCNORM='LIVETIME' when those native fields are available. The lc_errmethod setting controls only the reported statistical ERROR values. In auto mode, trusted source and background count/exposure information selects Gehrels errors independently for each curve and combines their variances in the net curve; without that information the input ERROR values are retained and a warning is issued. Explicit gehrels mode fails when the required information is absent. Gehrels values are a symmetric approximation, not strict Poisson confidence intervals. Bins without usable exposure retain NaN rates, and negative background-subtracted RATE values are not clipped. Count and exposure semantics are taken from the native curve metadata.

AREA, TIMING AND STATISTICAL CONTRACTS

Multi-observation extraction reopens each atom's original event file. Use FK5/ICRS sky regions to select the same celestial aperture in different pointings. Image/physical regions are accepted only when the merged event and every atom have matching EVENTS X/Y WCS; otherwise the task stops before extraction and requests sky regions.

For partial coverage, REGAREA describes the complete selected region, including the portion outside the exposure image. Only the covered part contributes to EFFAREA. A source atom with no usable coverage is omitted from extraction and stacking and is recorded as skipped_no_coverage in the prep plan. If no source atom is usable, the task stops. Missing background coverage still stops a background-enabled extraction. The original atoms remain in the response context.

Exposure-map coverage measures the positive-pixel footprint. Both pixel and sky regions use the same projection-plane area in square degrees on this path. For attitude or obs_gti coverage, a celestial polygon without exclusions uses the first vertex's spherical_offsets longitude/latitude plane, matching the shared DS9 polygon predicate; its area is integrated with the spherical cosine Jacobian and written in square degrees. This is not a great-circle polygon definition. Celestial source regions with exclusions continue to use the existing weighted sampling path, including its existing RA-wrap and polar sampling limits. Other shapes, native pixel areas in obs_gti mode and the exposure-map path are unchanged. The workflow retains EFFAREA=REGAREA*FRACAREA; exposure amplitudes, vignetting and PSF corrections are not additionally applied to BACKSCAL. This is not a new effective-exposure model or an exact wide-field solid-angle calculation. Coverage files and prep records state the area unit, coordinate frame and coverage method. Source and background must use compatible units, frames and the same coverage method.

Attitude coverage accepts celestial regions. Pixel/physical coordinates require a verified reference: auto selects exposure-map coverage when the matching celestial-WCS exposure map is provided and otherwise reports an error. Supply a verified equivalent sky region, or explicitly choose coverage_mode=obs_gti. In that limited mode, same-frame pixel areas retain their native pixel-squared values; they cannot be mixed with angular areas. Shared DS9 masks follow the IRAF relation image=LTM*physical+LTV, including cropped images with nonzero LTV.

Background scaling records distinguish counts_alpha (also retained as the legacy alpha) from rate_alpha. Net light curves use the rate-domain area ratio and the common-bin/GTI/FRACEXP requirements of fxtlccorr. An existing whole-bin RATE cannot recover counts for a narrower common GTI; re-extract such inputs. Stage manifest versions are prep v4, extract v5, response v4 and combine v6. Prep v3 and earlier manifests are deliberately rejected for resume because their polygon area and scaling cache may use the pre-v4 semantics; extract v4 and earlier manifests, and response v3 and earlier manifests, are likewise rejected so stale downstream BACKSCAL/response products cannot pass through unchanged. Rebuild prep, extract and response, then any downstream stage that references them. Earlier combine outputs require regeneration to preserve BACKSCAL, background-combination policy, floating background errors, and observation metadata through fxtspecmerge. Re-run affected stages in a new output directory or with the appropriate overwrite setting.

Different covered areas can give source spectra different BACKSCAL values. Combined source BACKSCAL is weighted by its exposure times; background BACKSCAL follows the selected combination method. The bkgmethod setting selects the Chandra-style background treatment: time sums measured background counts with exposure-weighted source/background BACKSCAL values, asca applies the ASCA scaled-count construction, counts uses per-channel effective-Poisson moment matching, and weighted rescales counts and variances to preserve the source-aperture background contribution. auto selects time, counts, or weighted according to the input statistics when explicitly selected. The default is asca, matching CIAO. Original area values and headers remain in MERGE_INPUTS. With the default stack=auto fallback=jointfit, spectra with incompatible channel grids or observation selections retain their original PHA, ARF and RMF in a joint-fit bundle. The generated XSPEC script loads each PHA from its own directory, applies the same energy range to every spectrum, and treats XSPEC error messages as failure even if the process exits with status zero.

Source PHA STAT_ERR values are propagated as independent variances; Poisson inputs without explicit errors keep their count-sum representation. An explicitly non-Poisson source without STAT_ERR, nonzero SYS_ERR with unspecified correlation, or POISSERR=T together with an explicit STAT_ERR column or nonzero error keyword is rejected. The standard OGIP placeholder POISSERR=T with STAT_ERR=0 and no error column is accepted. Resolve conflicting Poisson or explicit-error representations before combining. This does not select a fitting statistic automatically.

Combined backgrounds use floating COUNTS whenever scaling or model inputs require them; they are not rounded to integers. Explicit STAT_ERR values propagate as independent variances, including the square of each scaling coefficient. Such weighted backgrounds are not new Poisson measurements. Covariance shared by background models or calibration inputs is not available from marginal STAT_ERR arrays. Joint fitting the original per-atom pairs remains available for likelihoods requiring those separate measurements. The separate merged RMF now uses energy-dependent ARF times exposure times AREASCAL weights and is a science response, while the PHA retains its existing link to the folded combined RSP. DATE-OBS/DATE-END cover the input time envelope and common grade/mode metadata are preserved. XSPEC readability is not fit convergence or scientific acceptance.

BACKSCAL AREA CONVENTION

Science source and local-background PHA files use dimensionless BACKSCAL: selected area in deg2 divided by 601^2 * (0.002685739662709 deg)^2 (about 2.60541416 deg2). This fixed reference matches native FXT XSELECT/extractor spectra and the 20250509 particle templates. BSCALUNI=1 identifies a dimensionless fraction; BKGREF=361201, BKGPIXA and BKGUNIT=deg2 state its reference area. REGAREA/EFFAREA and prep scaling values retain the unit recorded in AREAUNIT; pixel2 coverage is converted using the atom EVENTS X/Y WCS and its physical-coordinate transform before writing BACKSCAL. Missing pixel geometry is an error.

Both source and local-background BACKSCAL values receive the same normalization, so their XSPEC area ratio and light-curve scaling are unchanged. Earlier srcproducts PHA files stored angular area directly; pairing those files with extractor or particle-background spectra produces a factor of about 2.605 error. Regenerate those science PHA files and all downstream responses/combined outputs; do not relabel old values. Extract v4, response v3 and combine v5 caches and earlier versions are rejected. Prep v4 remains usable. Particle-template reference metadata is retained by fxtbkggen, with BSCALUNI=1 when its reference is known. Unknown template conventions remain unlabelled and require explicit area for map generation. IMG monitoring spectra retain their separate, explicit 600^2 reference and are not science source PHA files.

CALIBRATION AND MULTI-OBSERVATION LIMITS

Resume checks the configuration, alias, index and file contents of the indexed FXT CALDB. A calibration replaced at the same path invalidates saved stages; older manifests without a verifiable content inventory also require regeneration. This is an inventory identity check, not evidence that all indexed files were selected or that upstream HL products were reprocessed with this CALDB.

Each observation retains its own PHA, response, GTI, attitude and BADPIX inputs. Use this path for observations spanning different response epochs. Generating an ARF directly from a merged PHA does not guarantee arbitrary time-dependent TELDEF/VIGNET/PSF segmentation. A merged image does not supply a universal mixed PSF for morphology analysis; model each observation's PSF for that purpose.

FXT dead time is treated as negligible, retaining DEADPOL=FIXZERO. This approximation does not remove good-time filtering, spatial coverage or response corrections.

SEE ALSO

grppha, fxtlccorr, fxtlcmath, fxtobsmerge, fxtspecmerge, fxtrmfgen, fxtarfgen, fxtrmfmerge, fxtarfmerge

Manual page updated

2026-11-04