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

FXTSoft v2.0 documentation

fxtpical help

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

← Back to Command Reference

NAME

fxtpical -- Calculate PI column values of FXT event files

USAGE

DESCRIPTION

fxtpical assigns calibrated event energies and PI channels to FF, PW, and TM data, correcting for position-dependent gain, Charge Transfer Inefficiency (CTI), and changes in gain with time.

GAIN and CTI date-node extrapolation

The gain_extrapolation control applies to the dated GAIN tables used for both gain coefficients (GC0–GC2) and CTI coefficients (GC3–GC5). Within the available date range, all three modes use the same interpolation. caldb (the default) follows the active CALDB GAIN_POLICY flags. hold uses the nearest endpoint outside the available date nodes, and therefore does not extrapolate. linear uses the two endpoint nodes to extend the same linear interpolation beyond the range. The explicit hold and linear modes override policy endpoint flags, but never combine entries across a GAIN_POLICY regime or the 2026-04-26T15:04:00 FXTB heat break. A single available node is always held. The selected mode, files, dates, interpolation weight, policy, and whether an extrapolation actually occurred are recorded in FITS provenance: IGEXMODE identifies the effective mode, IGPOLICY identifies the actual selection policy, and IGEXTR is true only when the selected gain pair is extrapolated. These values and the corresponding HISTORY entries describe the effective calibration; they do not change GAINCORR or TMGAINCORR selection.

Grade-specific DELTAE curves

The selected GAINCORR file may include an optional DELTAE_G13 extension for grades 1 and 3. When present, this curve replaces DELTAE_G4 for those events; the two curves are not added together. Grades 2 and 4 continue to use DELTAE_G4. Without DELTAE_G13, all grades 1–4 retain their previous DELTAE_G4 correction. Grade 0 uses DELTAE_G0, and grades 5–12 use DELTAE_G12.

G13 here denotes grades 1 and 3, not event grade 13. The optional table has scalar E and DELTA columns in keV (an omitted column unit also means keV), with at least two finite, strictly increasing energy nodes and finite corrections. A present but malformed table is an error, not a fallback. A valid all-zero curve is used as zero. Positive DELTA is subtracted from the event-total energy before the count-rate and time-drift corrections; the corrected total is then redistributed to the split pixels. G13 uses the existing DELTAE interpolation and endpoint clipping, with linear interpolation for a two-node curve. The G4 base gain/CTI, TMCORG4, dated TM correction, and PW/TM final shifts remain shared by grades 1–4.

This lookup requires no new command-line parameter. New software can use legacy CALDB files unchanged. Older software ignores DELTAE_G13 and therefore cannot apply the separate grade-1/3 curve.

Gain-correction selection

All data first use the ordinary GAINCORR selected from CALDB. TM data additionally use dated TMGAINCORR curves for the matching detector. The task linearly interpolates the two curves bracketing DATE-OBS. Before the first dated curve it uses HOLD_FIRST; after the last dated curve it uses HOLD_LAST. The selected filenames, dates, interpolation weight, and policy are written to FITS keywords and HISTORY.

Processing provenance is kept in the output FITS headers and HISTORY. The task does not create a separate <outfile>.history.txt file; keep the FITS product when preserving its calibration record.

For backward compatibility, a legacy CALDB with no active TMGAINCORR rows keeps the previous TM behavior and emits an UNAVAILABLE_LEGACY_FALLBACK warning and provenance record. Missing or malformed files referenced by an active row remain fatal errors.

PW and TM final event-energy shifts

The preferred curve interface uses PWSHIFT_E and TMSHIFT_E binary-table extensions inside the same selected GAINCORR FITS file. Each has exactly three scalar columns: GRADE (0, 4, 12 denote exclusive grades 0, 1–4, 5–12), E (energy before this residual correction), and SHIFT (energy to add). E and SHIFT require explicit energy units convertible to keV. Each grade requires at least two finite, strictly increasing energy nodes. Required headers are MSHVER=1, MSHALG=PCHIP, MSHBOUND=HOLD, and MSSTAGE=POSTDRIFT.

All detectors and modes use the same PCHIP algorithm, initialized when the table is loaded. The formula is Enew = E + SHIFT(E); only the lookup coordinate is clamped to the first/last node, not the event energy. The mapping derivative must remain strictly positive throughout every interpolation segment. The valid curve replaces the old affine residual; the two are never added together. A malformed or duplicate present curve is an error, not a reason to silently fall back. FF ignores both interfaces. The independent TMGAINCORR correction is unchanged. The residual is evaluated on the corrected group total in fxtpical, then redistributed to split rows using their raw CHANNEL fraction. fxtgrade does not consume this residual.

IMSALG, IMSBOUND, node counts, energy support, derivative extrema, and a canonical-node SHA256 are written to the output; HISTORY includes all nodes. Stale affine coefficient cards are removed when a curve is active. Node agreement and positive mapping derivatives do not validate line widths, extrapolation bands, grade transfer or epoch transfer. Use a matched software/CALDB pair: older software may ignore the new extensions and silently apply only the legacy affine table.

If no matching curve extension is present, the legacy interface below is preserved, including its exact zero-shift behavior.

The selected GAINCORR file may contain a PWSHIFT extension for PW or a TMSHIFT extension for TM. FF uses neither. Each table has exactly three rows for exclusive grades 0, 1–4, and 5–12. The columns are PISHIFT1 (dimensionless) and PISHIFT2 (keV). The PICAL group-total energy is corrected as Enew = E + PISHIFT1 * E + PISHIFT2, after all existing gain, TMGAINCORR, count-rate, and time-drift corrections, before redistribution to split rows and PI recalculation. The constant is applied once per PICAL group, not once per pixel. This residual correction does not replace the independent, dated TMGAINCORR curves.

A zero coefficient pair bypasses arithmetic, preserving the previous energy/PI result. In particular, zero TMSHIFT leaves the selected TMGAINCORR correction unchanged. A missing mode-shift extension is recorded as UNAVAILABLE_LEGACY_FALLBACK for old CALDB compatibility; an existing malformed table, incompatible explicit units, non-finite values, or PISHIFT1 <= -1 is an error. Blank legacy units are interpreted as dimensionless/keV. Explicit compatible units are converted to these units (for example, eV to keV for PISHIFT2). The coefficients, extension, status, and application stage are recorded in IMS* keywords and HISTORY; the enclosing GAINCORR file remains part of the CALDB provenance. Changes require a rerun from the original input, not recalibration of previously corrected events.

No new command-line parameter is required. Use a released CALDB appropriate for the detector, mode, and observation date; the presence of a correction table alone does not establish its validity for a particular observation.

For every output, fxtpical records the direct application in the primary and EVENTS headers: IMSHVER=1, IMSPEND=F, IMSOWNER=FXTPICAL for PW/TM, IMSSTAT=APPLIED (or ZERO), and IMSSTAGE=POSTDRIFT. FF is marked NOT_APPLICABLE. These headers are provenance only; no deferred payload is handed to fxtgrade. IMSOWNER=FXTPICAL identifies the task responsible for the PW/TM decision; IMSSTAT distinguishes an applied model, a zero model, and unavailable legacy calibration.

Calibration tables must be validated for this PICAL group definition. Native fxtgrade can later combine TM frame-boundary groups; applying a nonzero residual to each PICAL group is generally not equivalent to applying it once to the combined event. This release preserves the deployed PICAL behavior and does not establish that equivalence.

Reprocessing must start from the original pre-PICAL pixel input, not from an already corrected product. Re-running PICAL is not an inverse-calibration operation. The GAINCORR file remains part of CALDB provenance, and changes require a fresh run from the original input.

PARAMETER SUMMARY

This table is synchronized with the installed HEASoft parameter file. Mode letters follow the standard PFILES convention.

ParameterTypeModeDefault / rangePurpose
evtfilesqrequiredThe input evt file
outfilesqrequiredThe output evt file
clobberbhyesOverwrite existing output file (if outfile!=NONE)?(yes/no)
gain_extrapolationshcaldbGAIN/CTI extrapolation outside CALDB date nodes (caldb/hold/linear)
verboseih1; range 0 .. 2Logging verbosity
modeshqlQuery/learn mode

PARAMETERS

evtfile [file name]
Name of the input event FITS file.

outfile [file name]
Name of output event FITS file.

(clobber=yes) [boolean]
If 'clobber'=yes and outfile=filename, the file with the same name will be overwritten, if it exists.
verbose
Logging verbosity: 0=warning/error, 1=normal info, 2=debug. Default: 1.

gain_extrapolation
Select the endpoint behavior for dated GAIN and CTI tables outside their available date nodes: caldb keeps the active CALDB policy (default), hold keeps the nearest endpoint, and linear extends the two-node interpolation. All modes remain within the selected policy or thermal regime, and a singleton node is held.

Deprecated post-break compatibility
The old postbreak_extrapolate command-line keyword, learned-PFILE value, and FXTPICAL_FXTB_POSTBREAK_EXTRAPOLATE environment variable remain accepted temporarily and emit a deprecation warning. They retain their historical FXTB post-break fallback behavior only when gain_extrapolation=caldb is in use and no applicable GAIN_POLICY is available. An explicit gain_extrapolation command-line value (including caldb), a non-default learned-PFILE mode (hold or linear), or an FXTPICAL_GAIN_EXTRAPOLATION environment value takes precedence; the old value is then ignored. Whether the old value applied or was ignored, and why, is recorded only in HISTORY; no IGPBEXT keyword is written. Use gain_extrapolation for new scripts.

EXAMPLES

  1.  >fxtpical evtfile=evtfile outfile=outfile
        
  2.  >fxtpical evtfile=evtfile outfile=outfile gain_extrapolation=hold
        

BUGS

SEE ALSO

Manual page updated

2026-11-04

CALDB table compatibility (2026-11-01)

This implementation supports optional TYROW, TYALIGN schema 3 and GAINMAP schema 1 records for FF mode. Legacy CALDBs without these extensions remain supported. Applied tables record their own schema/model and time-selection status in the output.

CALDB table compatibility, correction order, and time provenance details