FXTSoft v2.0 documentation
fxtsrcproducts help
Command help for fxtsrcproducts in the FXTSoft v2.0 release.
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
| Parameter | Default / values | Summary |
|---|---|---|
evtfile | required | Context-aware merged event file used as the user-facing container |
rspctx | required | Response context JSON produced from the context-aware event merge |
sources | required | JSON source specification: a top-level list or an object with a sources list; each source has srcregion and may have bkgregion |
config | NONE | Optional TOML workflow configuration; NONE keeps the legacy parameter interface |
outdir | required | Output source-products directory |
response | yes | Run per-atom RMF/ARF command generation after xselect products (yes/no) |
expfiles | NONE | Optional exposure-map files, comma-separated or @listfile, matched to response atoms |
stack | auto | Stack mode: auto, jointfit, combined, or none |
fallback | jointfit | Fallback when response compatibility fails: jointfit or fail |
datamodes | FF,PW | Comma-separated modes to process; FF and PW are supported, while TM is skipped |
coverage_mode | auto | Source coverage mode: auto, attitude, exposure, or obs_gti |
coverage_tstep | 1.0 | Maximum source-coverage attitude sampling step in seconds |
coverage_accuracy | standard | Spatial coverage sampling accuracy: fast, standard, or precise |
coverage_grid | 16 | Spatial coverage grid samples per axis |
coverage_minfrac | 0.01 | Minimum valid area fraction for a time sample to enter SRCGTI |
coverage_warnfrac | 0.1 | Warn when mean valid area fraction is below this value |
arf_mode | auto | ARF mode: auto, aspect, exposure, or none |
arf_weight | aspect | Aspect ARF weighting mode: aspect or event |
arf_thetabin | 0.05 | Aspect ARF theta-bin width in arcmin |
backscal_policy | source_effarea | BACKSCAL policy: source_effarea or region_area |
background_policy | local_sky | Background policy: local_sky or none |
bexpscale | 1000.0 | Compatibility parameter accepting only 1000; background exposure is not rescaled |
bkgmethod | asca | Background combination method: auto, time, asca, counts, or weighted |
products | spectrum,curve,image | Comma-separated xselect products to extract: spectrum, curve, image |
lc_errmethod | auto | Light-curve error method: auto, input, or gehrels |
clobber | yes | Overwrite existing output files (yes/no) |
verbose | 1 | Logging verbosity: 0=warning/error, 1=normal info, 2=debug |
response_mode | context_merged | Response mode; context_merged is required for merged events |
background_region | auto | Background region mode: auto, manual, or none |
bkg_inner_factor | 2.5 | Inner radius factor for auto annulus background regions |
bkg_outer_factor | 5.0 | Outer radius factor for auto annulus background regions |
bkg_min_area_ratio | 5.0 | Minimum auto-background area divided by source area |
lc_binsizes | 1 | Comma-separated light-curve bin sizes in seconds; first bin keeps the legacy .lc name |
response_kernel | xselect | Extraction kernel; xselect is used for PHA/LC/image extraction |
xspec_smoke | yes | Write XSPEC joint-fit smoke-test script (yes/no) |
xspec_run | no | Run XSPEC smoke test after writing script (yes/no) |
xspec_run_mode | script_tty | XSPEC run mode: stdin, atscript, or script_tty |
subtract_background | no | Write background-subtracted light curves during extraction (yes/no) |
group_min_counts | 0 | Group spectra to this minimum count threshold; 0 disables grouping |
resume | no | Reuse successful compatible stage manifests and outputs (yes/no) |
dryrun | no | Write scripts and manifest without running xselect/response commands (yes/no) |
keepintermediate | yes | Keep rebuildable XSELECT scripts and source/background GTIs (yes/no); dryrun always keeps them |
mode | ql | Query/learn mode |
bkgmethod | asca | Background combination method: auto, time, asca, counts, or weighted |
lc_errmethod | auto | Light-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
sourceslist. Each source should providesrcregionand may providebkgregion. Required. - config
- Optional TOML workflow configuration. When supplied, only
outdir,resume,dryrun,clobber, andverbosemay 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, ornone. Default:auto. - fallback
- Fallback when response compatibility fails:
jointfitorfail. Default:jointfit. - datamodes
- Comma-separated datamodes to process. Default:
FF,PW. - coverage_mode
- Source coverage mode:
auto,attitude,exposure, orobs_gti. Default:auto. - coverage_tstep
- Maximum source-coverage attitude sampling step in seconds. Default:
1.0. - coverage_accuracy
- Spatial coverage sampling accuracy:
fast,standard, orprecise. 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, ornone. Default:auto. - arf_weight
- Aspect ARF weighting mode:
aspectorevent. Default:aspect. - arf_thetabin
- Aspect ARF theta-bin width in arcmin. Default:
0.05. - backscal_policy
- BACKSCAL policy:
source_effareaorregion_area. Default:source_effarea. - background_policy
- Background policy:
local_skyornone. Default:local_sky. - bexpscale
- Only
1000.0is 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.
autoselectstimefor measured Poisson backgrounds,countsfor effective-Poisson remerges, andweightedfor model backgrounds. Explicit choices aretime,asca,counts, andweighted. The value is case-insensitive. Default:asca, matching CIAO. - products
- Comma-separated xselect products to extract:
spectrum,curve, andimage. 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 inputERRORcolumn and emits a warning.inputalways retains the nativeERRORvalues.gehrelsrequires 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
grpphacommand usinggroup 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