FXTSoft v2.0 documentation
fxtobsmerge help
Command help for fxtobsmerge in the FXTSoft v2.0 release.
NAME
fxtobsmerge -- Reproject FXT events once, then select energy bands and stack per-observation images; optionally merge events, exposure maps and background products.
USAGE
fxtobsmerge inputmode=obs indirlist=@obs.lst outdir=merged ra=180 dec=0 width=15 height=15 fxtobsmerge inputmode=events evtfiles=@evt.lst mkffiles=@mkf.lst attfiles=@att.lst orbitfiles=@orb.lst outdir=merged fxtobsmerge inputmode=images imgfiles=@img.lst expfiles=@expo.lst outdir=merged ra=180 dec=0 pixsize=auto fxtobsmerge inputmode=mixed evtfiles=@evt.lst expfiles=@expo.lst outdir=merged
DESCRIPTION
combine=none retains the default detector/filter groups. With combine=images, requested image families are also summed within each readout mode under merged/ff/, merged/pw/, or merged/tm/. With combine=spectra response=yes, each source's per-observation PHA, background, ARF and RMF bundles are combined under merged/MODE/srcproducts/ using fxtspecmerge checkfilter=no. Every input spectrum must still match its own responses, channel grid and selections. Cross-group physical/image regions require identical event WCS; use FK5 or ICRS regions when grids differ. combine=all combines only the requested image and spectral families and does not enable response extraction automatically.
With indirlist, event, MKF, attitude, orbit, science-image, and exposure lists may be omitted when the matching files are present below the listed directories. The directories need not share an OBSID or HL layout; keep the standard product names so observation, detector, mode, filter, and processing version remain identifiable. Automatically selected science images exclude FSA images and products from other processing versions.
expofiles=@expo.lst (also spelled expfiles) accepts ordinary and non-vignetted exposure maps in one list, even in separate directories. They are kept in separate merge channels. Particle-background calculation requires maps with VIGNAPP=F. For legacy XIMAGE image products carrying DATAMODE=PHOTON, the explicit FXT readout mode in the standard filename is used for matching; other conflicting mode identities still fail. With autoexp=yes, a missing ordinary map or a missing non-vignetted map needed for background is generated from the matching science event and MKF.
products=all is the default and includes per-observation particle-background preparation when complete matching FSA event data are available. Use products=bkg to request the background stages and their required event/exposure prerequisites. Use products=evt for event products without exposure or background processing, or products=evt,img,expo,rate when no FSA inputs are available. Rate and background processing also run their event and exposure prerequisites. response=yes separately enables source products.
forcechain=yes is available only with inputmode=obs and a non-empty indirlist. It reruns the installed fxtchain through exitstage=2 from raw UF event inputs, ignores existing per-observation event, image, and exposure products, and writes regenerated products below the independent outdir. Set forcechain=no (the default) to retain normal reuse and missing-product preparation. Forced runs require autoexp=yes, cannot use resume=yes, and do not accept explicit evtfiles, imgfiles, expfiles, or expofiles. The software and CALDB are those initialized in the running environment.
For raw UF event preparation, expr=DEFAULT uses the selected CALDB housekeeping expression. An explicit expr is passed to GTI generation for raw science and FSA events (and to fxtchain in forced runs); it does not re-screen already clean input events. If the generated GTI or its intersection with the input event GTI has zero exposure, processing stops before creating a clean event or exposure map and reports the observation, MKF, and expression. Review the MKF and screening policy before choosing a different expression; the program does not silently relax CALDB cuts.
fxtobsmerge combines event, MKF, image, and exposure inputs from one or more observations and writes merged science products. It can also generate exposure, background, rate, and response products when the corresponding options are enabled.
When indirlist is supplied, supported products are searched recursively; they do not need to be arranged in the standard fxt/products/HLn tree. File names and FITS identity metadata must still provide compatible OBSID, detector, datamode, filter, and processing-version matches. Use expfiles or its expofiles alias to provide exposure maps explicitly.
Recursive discovery excludes this run's outdir/merged,
outdir/obs, outdir/reprocess, and all
.caldb-output-* transaction trees, including resolved path aliases.
Automatically discovered EVENTS carrying RPPROTO or a true
MERGED marker are not new science observations. This makes repeated
runs with an output directory below an input directory safe, including a change
of image energy band. Explicit evtfiles=@reprojected_events.lst
cache reuse remains supported.
After normal HL/version and requested-mode selection, each remaining science
event must have a distinct (OBS_ID, DETNAM, DATAMODE, FILTER)
identity. Ambiguous duplicates, including an original event plus its copied or
reprojected counterpart, fail before merging and report both paths. Select one
event product per observation identity; do not mix overlapping copies or
multiple sequence products with the same identity. Explicit event lists use
the same duplicate check.
Observation identity must come from an observation identifier rather than a short numeric date-directory component. Event columns must be compatible; missing scientific columns are not silently filled. Packed bits and column units are retained, while time coordinates are converted to seconds. Event-generated count images use pixel centres and the same half-pixel boundaries as their output WCS.
Auxiliary interval columns are normalized together. Additional auxiliary HDUs are retained per source, rather than silently discarded. Image, exposure, rate and net products require consistent physical units and aligned coverage; sparse sky tiles outside the input footprint may be omitted, but a required paired tile must not disappear silently. These merge operations read calibration files when needed and do not modify CALDB data or indexes.
OUTPUT LAYOUT
Every successful ordinary run (that is, a non-dry-run with forcechain=no) creates the common top-level merged/, obs/, and reprocess/ directories, then creates only the group directories identified by input discovery. A group identity is the actual detector, readout mode, and filter combination, such as fxta_ff_01. The usual science modes are ff, pw, and tm; an input identified as df is grouped and written under the corresponding ff directory. No empty Cartesian product of detectors, modes, or filters is created, and df, dt, and ds directories are not precreated. Only filters and detectors present in the selected inputs receive directories. An all directory is created only for an actual ungrouped image/exposure route; it is not added to event runs. Unknown or legacy group identities remain under the discovered group name when they are actually supplied. The same input groups receive the same directory layout regardless of the requested product families or input mode. Empty stage directories are structural and contain no placeholder FITS files. The DF/FF alias changes grouping and filename matching only; source FITS headers are retained, and conflicting FITS DATAMODE values still fail strict compatibility checks.
outdir/
fxtobsmerge_manifest.json
merged/
GROUP/ # each discovered group across selected observations
srcproducts/ # present even when response=no
cl_event_merged.fits
fsa_cl_event_merged.fits
counts_merged.fits
img_merged.fits
expo_merged.fits
expo_without_vign_merged.fits
rate_merged.fits
fsa_merged.pha
fsa_spectra.lst
img_monitor_merged.pha
img_monitor_spectra.lst
particle_bkg_merged.pha
particle_bkg_spectra.lst
particle_bkg_fsa_merged.pha
particle_bkg_fsa_spectra.lst
bkg_counts_*.fits
band_counts_*.fits
net_counts_*.fits
net_rate_*.fits
mkf_merged.fits
att_merged.fits
orbit_merged.fits
response_context.json
obs/
OBSID/ # an actual selected observation
GROUP/ # only groups present in this observation
event/
reprojected/
images/
fsa/
expo/
bkg/
reprocess/ # empty unless forcechain=yes
RUN_ID/ # forcechain only; older RUN_IDs remain
OBSID/ # chain products for this run
obs/
OBSID/
GROUP/ # compact groups present in this observation
The merged product basenames are stable generic names inside each merged/GROUP/ directory; group identity is represented by the directory rather than by a filename prefix. Every discovered merged group also has srcproducts/, including when response=no. A background request writes the merged full-FSA monitor fsa_merged.pha and fsa_spectra.lst. With the default normmethod=fsa, particle_bkg_merged.pha and particle_bkg_spectra.lst are the final particle model. With normmethod=imghe, img_monitor_merged.pha and img_monitor_spectra.lst are added, particle_bkg_fsa_merged.pha and particle_bkg_fsa_spectra.lst retain the FSA-normalized comparison, and particle_bkg_merged.pha is the single IMGHE-normalized result. Background, band-count, net-count, and net-rate tiles are also written. Every selected observation/group pair has the uniform stage tree event/reprojected/, event/images/, fsa/, expo/, and bkg/; these directories may be empty when a stage is not needed. Existing reused exposure and FSA products are referenced in place and are not copied into the output, so their slots may remain empty. The manifest records whether each selected product was generated, reused, or missing. A request for full products fails with the missing input context instead of writing placeholder FITS files. Auxiliary MKF, attitude, and orbit lists are filtered to the OBSIDs represented by each group's event files. Existing unselected observation and forcechain trees are retained and are not removed automatically.
With the default clobber=yes, repeated runs replace each active merged group in full and preserve other groups and unrelated top-level entries in merged. This allows separate FF/PW or group batches to share an outdir without deleting each other. Replacing an active group removes its old products that the new run does not produce, avoiding stale responses or images from an earlier selection. clobber=no still rejects an existing planned output before processing.
On filesystems without no-replace directory rename, clobber=no exclusively creates the destination and each child before publishing the manifest last. Existing paths are never overwritten. The directory can be visible while publication is in progress; wait for successful task completion before reading its products. A publication failure rolls back the entries created by that run; an interfering writer's files are preserved and reported as requiring recovery.
For response=yes, relative srcregion and bkgregion file names are resolved against the directory where the command was invoked. Paths within an explicitly supplied sources JSON file retain their JSON-relative meaning. Response extraction uses short relative paths to its prepared time filters and rejects XSELECT filter-read errors even if spectrum files were written.
Use inputmode=obs indirlist=@obs.lst for complete observation discovery. This is the preferred entry point when an observation directory contains events, housekeeping, attitude, orbit, and existing product files. inputmode=events remains available for explicitly controlled event lists and uses the same output layout.
PARAMETER SUMMARY
Event compatibility checks the full effective DSTYPn=GRADE /
DSVALn selection, not only its upper endpoint. Different selections
(for example 0:4 and 0:12) or malformed declarations fail
the compatibility check under the default strict policy. Inputs without a GRADE
declaration retain the legacy 0:12 assumption. Do not combine differently
filtered grade sets into one science spectrum.
| Parameter | Default / values | Summary |
|---|---|---|
inputmode | obs | Input source mode: obs, events, images, mixed, or slew |
indirlist | NONE | Input observation directories, comma-separated or @listfile; use NONE for manual file lists |
evtfiles | NONE | Input event files, comma-separated or @listfile |
mkffiles | NONE | Input MKF attitude files, comma-separated or @listfile |
expr | DEFAULT | GTI screening expression for raw event/FSA preparation; DEFAULT uses the selected CALDB HK expression |
imgfiles | NONE | Input image files, comma-separated or @listfile |
expfiles | NONE | Input exposure-map files, comma-separated or @listfile |
expofiles | NONE | Alias for expfiles; input exposure-map files, comma-separated or @listfile |
autoexp | yes | Generate exposure maps from events and MKF files (yes/no) |
emin, emax | unset | Photon-image energy bounds in keV. Applied only during image binning, never to the persisted reprojected events. |
expenergy | 1.5 | Mono energy in keV used by fxtexpogen when autoexp=yes |
outdir | required | Output directory |
mode | auto | Merge mode: auto, small, large, or slew |
ra | auto | Output center RA in degrees, or auto to infer from input coverage |
dec | auto | Output center Dec in degrees, or auto to infer from input coverage |
width | auto | Output sky width in degrees, or auto to cover the input footprint |
height | auto | Output sky height in degrees, or auto to cover the input footprint |
pixsize | auto | Output pixel size in arcsec, or auto to infer from FITS WCS |
expomaskfrac | 0.1 | Per-input fraction of center exposure; already merged maps are not masked; <=0 disables |
bkgimgpixels | AUTO | Derive the exposure-map pixel denominator from particle-spectrum BACKSCAL; a positive number is an explicit override |
bkgemin | 0.5 | Particle-background minimum energy in keV; included in the selected band |
bkgemax | 10.0 | Particle-background maximum energy in keV; excluded from the selected band |
normmethod | fsa | Merged particle-spectrum normalization: fsa uses the FSA monitor; imghe uses the merged IMG high-energy monitor |
heregion | NONE | Source-free FK5/ICRS DS9 region for the IMG monitor; required by normmethod=imghe; ALL is an explicit contamination-prone diagnostic choice |
hemin, hemax | 9.0, 10.0 | IMGHE E2PI normalization band in keV, half-open [hemin, hemax); finite 0.5 <= hemin < hemax, with the input E2PI table setting the effective upper edge |
products | all | Requested product families: all or comma-separated reproject,evt,img,expo,bkg,rate,response. Omitting bkg skips particle-background preparation. |
combine | none | Cross-group aggregation: none, images, spectra, or all. Joins detector/filter groups within each mode; spectra requires response=yes. Totals are written to merged/ff, merged/pw, or merged/tm while retaining the original groups. A single group is reused without a duplicate directory. |
datamodes | all | Datamodes to include in directory or grouped file discovery: all or comma-separated FF,PW,TM,DF,DT,DS; DF and FF select the same output group, and no mode directory is precreated without matching data |
forcechain | no | Rerun the installed fxtchain to exitstage=2 from raw UF inputs; requires inputmode=obs with indirlist |
response | no | Run fxtsrcproducts source-product orchestration after event merge (yes/no) |
sources | required when response=yes and srcregion=NONE | JSON source list for fxtsrcproducts |
spectral_mode | stack_then_merge | Spectral response strategy: stack_then_merge only (per-observation responses; compatible stacking or joint fit) |
srcregion | NONE | Source region for optional spectral stack products |
bkgregion | NONE | Background region for optional spectral stack products |
psfcor | 1 | PSF correction switch for optional point-source ARF generation |
clobber | yes | Overwrite existing output files (yes/no) |
verbose | 1 | Logging verbosity: 0=warning/error, 1=normal info, 2=debug |
attfiles | NONE | Input attitude files, comma-separated or @listfile |
orbitfiles | NONE | Input orbit files, comma-separated or @listfile |
resume | no | Reuse completed manifest stages when hashes and parameters match (yes/no) |
dryrun | no | Write a separate planned-output JSON without creating science products or compact output directories (yes/no) |
manifest | auto | Manifest path, or auto to write fxtobsmerge_manifest.json in outdir |
mergepolicy | strict | Compatibility policy for stage gates: strict, warn, or force |
caldb_policy | strict | CALDB provenance policy for resume: strict, warn, or ignore |
keepintermediate | yes | Keep stage intermediate products (yes/no) |
validate | yes | Run built-in product validation and record results (yes/no) |
PARAMETERS
- inputmode
- Input source mode:
obs,events,images,mixed, orslew. Default:obs. - indirlist
- Observation directories, comma-separated or
@listfile. UseNONEwhen providing files manually. - evtfiles, mkffiles
- Input event and MKF files, comma-separated or
@listfile. Used by event, slew, mixed, and manual obs workflows. - expr
- GTI screening rule for raw UF science/FSA events.
DEFAULTselects the initialized CALDB HK expression. A quoted explicit rule is allowed when its screening policy is justified; changing it also changes the manifest request identity. It does not alter an already clean event. Zero-duration GTIs fail with the input context instead of producing all-zero exposure maps. - imgfiles, expfiles, expofiles
- Input image and exposure-map files, comma-separated or
@listfile.expofilesis an alias forexpfiles. - autoexp
- Generate exposure maps from events and MKF files. Values:
yesorno. Default:yes. - emin, emax
- Optional photon-image energy limits in keV. Omitted endpoints are unbounded. Selection uses the same ENG/ENERGY/PI convention as fxtimage: ENG/ENERGY endpoints are inclusive; PI selection uses the matching CALDB E2PI table and its half-open row interval. Counts and count-rate images follow these bounds. They do not change the full-energy event products,
expenergy, or the separatebkgemin/bkgemaxbackground band. Energy bounds require event inputs. - expenergy
- Mono energy in keV passed to
fxtexpogenwhenautoexp=yes. Default:1.5. - outdir
- Output directory. Required.
- mode
- Merge mode:
auto,small,large, orslew. Default:auto. - ra, dec
- Output sky center in degrees, or
autoto infer the center from the input coverage. Default:auto. - width, height
- Output sky size in degrees, or
autoto cover the input footprint. Default:autofor both dimensions. - pixsize
- Output pixel size in arcsec, or
autoto infer from FITS WCS. Default:auto. - expomaskfrac
- For each input exposure map representing one observation, mask pixels below this fraction of that map's center exposure before adding observations. Maps with
NMERGE>1, orMERGEDwithoutNMERGE, are kept without a second mask because their per-observation exposure cannot be recovered; a warning is issued. Use<=0to disable all exposure masks. Default:0.1. - bkgimgpixels
- Particle-background normalization denominator passed to
fxtbkgmap. Default:AUTO, which resolves the particle PHABACKSCALreference area and exposure-map pixel scale for each observation. Set a positive number to retain an explicit denominator. Each input area and provenance is recorded in the manifest. - bkgemin, bkgemax
- Half-open particle-background energy band in keV. Defaults:
[0.5, 10.0). Each observation is processed byfxtbkggenfollowed byfxtbkgmap, using PI values from its matching CALDB E2PI table. - normmethod
- Normalization for the merged particle spectrum. Default:
fsa, which applies the per-observation FSA normalization.imgheextracts and area/exposure-normalizes an IMG high-energy monitor for each observation, merges those monitors, and callsfxtbkggenonce on the merged FSA and IMG spectra. This parameter changes the merged PHA only; spatial background maps remain FSA-normalized. - heregion
- DS9 region used to extract the IMG monitor for
normmethod=imghe. The region must use FK5 or ICRS coordinates and be selected by the user in a source-free part of the cleaned IMG detector area; it is not inferred from the science source region.NONEis invalid forimghe.ALLdeliberately uses the whole valid IMG area and is allowed only as an explicitly contamination-prone diagnostic. The selected region is recorded in monitor provenance. - hemin, hemax
- Lower-inclusive, upper-exclusive E2PI band for
normmethod=imghe. Defaults:[9, 10)keV; finite interface range is0.5 <= hemin < hemax, and the input E2PI table sets the effective upper edge. For the formal PI 0..1023 table,hemax=12is allowed but IMGHE excludes PI 1023 because the highest real-energy row can contain events clipped from above the table, so the band uses at most PI 1022. The band is applied byfxtbkggento the merged IMG monitor and particle template; it is not thebkgemin/bkgemaximage-subtraction band. - products
allor comma-separated product family list:reproject,evt,img,expo,bkg,rate,response. Default:all.- combine
- Cross-group aggregation switch. Values are
none(default, retain separate detector/filter groups),images(aggregate the requested image, exposure, background and rate products),spectra(aggregate the per-observation source spectra with their backgrounds and ARF/RMF responses), orall(the union of the requested image and spectral families). Aggregation combines FXTA/FXTB and filters01/02only within the same readout mode; FF, PW and TM remain separate, and DF is grouped with FF. The original group products and event caches are retained.combine=spectrarequiresresponse=yes;combine=alldoes not turn response processing on. A value other thannoneis rejected when the selectedproducts/responsestages contain no corresponding family. Images use the already prepared common-grid per-observation products and do not reproject photon counts a second time. A summed exposure in seconds is an exposure-time bookkeeping product; when detector/filter effective areas differ it is not by itself a single flux-corrected area-time exposure. Use the per-observation responses for spectral or flux interpretation. If only one actual group participates, the combined entry can reuse that group result without copying it. - datamodes
allor comma-separated datamodes such asFF,PW,TM,DF,DT,DS. Default:all.DFandFFselect the same output group; directories are created only for modes present in the selected inputs.- forcechain
- Rerun the initialized FXTSoft
fxtchainthroughexitstage=2from raw UF inputs. It requiresinputmode=obsand a non-emptyindirlist; existing per-observation products are ignored and regenerated products are isolated belowoutdir. Default:no. Forced runs requireautoexp=yes, cannot combine withresume=yes, and cannot take explicit event, image, or exposure lists. - response
- Run
fxtsrcproductsafter event merge. Compatible spectral bundles use the same backend as the public fxtspecmerge command to combine source/background PHA, ARF and RMF products, preserve common observation selections and date envelopes, and retain exposure-weighted BACKSCAL values. Default:no. - sources
- JSON source list for
fxtsrcproducts. Required whenresponse=yesandsrcregion=NONE; ifsrcregionis provided,fxtobsmergewrites the source-list JSON automatically. - spectral_mode
- Only
stack_then_mergeis supported: extract each observation with its own ARF/RMF, then stack compatible spectra or retain them for joint fitting.from_merged_eventis rejected before processing. - srcregion, bkgregion
- Optional source and background regions for spectral stack products.
- psfcor
- PSF correction switch for optional point-source ARF generation. Default:
1. - clobber
- Overwrite existing output files. Default:
yes. - verbose
- Logging verbosity:
0for warnings and errors,1for normal information, and2for debug output. Default:1.
DOWNLOADED OBSERVATIONS
A standard downloaded observation is a complete starting point. No HL directory, precomputed image, exposure map, or clean FSA file is required:
11900008154/
auxil/ ep_11900008154_att_1ac.fits, ep_11900008154_orb_1ac.fits
fxt/event/ fxt_[a,b]_11900008154_ff_01_po_uf_evt_3ac.fits
fxt_[a,b]_11900008154_ff_01_po_uf_fsaevt_3ac.fits
fxt/hk/ fxt_11900008154_hk_1ac.fits, fxt_11900008154_mkf_1ac.fits
fxt/products/ fxt_[a,b]_11900008154_ff_01_po_cl_3ac.fits
With the defaults products=all autoexp=yes, the command reuses the selected clean science events, prepares missing clean FSA from raw FSA, generates missing ordinary and non-vignetted exposure maps, and builds photon images from science events even when existing images are present. If only raw science events are available, it performs the calibration and screening steps of fxtchain before merging. A raw _uf_evt_ file is screened even when it already contains PI. Generated-event GTIs intersect the screening GTI with the input GTI; generated FSA also uses the selected science GTI. Exposure and time bounds follow that intersection.
Preparation runs the individual FXT tasks in isolated parameter environments. Generated products are stored under outdir/obs/OBSID/GROUP/; input files are read only. Input directories may be renamed or organized differently, provided standard file names identify the observation and product roles. The discovered or explicitly supplied attitude and MKF lists are filtered to each group's event OBSIDs before preparation.
With forcechain=yes, the same arbitrary-depth discovery also searches directories containing HL without requiring that layout. Raw UF science, matching FSA when present, and auxiliary files are used to construct a complete fresh per-observation run. Existing HL or other processed products are not reused. A background request requires a matching raw FSA input. All stage-2 per-observation products, including spectra and responses, are regenerated even with products=evt; products controls the final merge only. Region extraction requires the corresponding region inputs, and source products after merging remain controlled by response=yes. Each forced run keeps chain products under the unique outdir/reprocess/RUN_ID/OBSID/ tree and per-observation work under outdir/reprocess/RUN_ID/obs/OBSID/GROUP/; merged products remain under outdir/merged/GROUP/. The run-local observation tree uses the same compact group selection and uniform observation-stage skeleton as the ordinary run: only groups actually present in that observation are created, with df grouped under ff. Older RUN_ID trees and observations are retained rather than replaced.
fxtobsmerge indirlist=@obs.lst outdir=merged fxtobsmerge indirlist=@obs.lst outdir=events_only products=evt fxtobsmerge indirlist=@obs.lst outdir=images_only products=img fxtobsmerge inputmode=obs indirlist=@obs.lst outdir=rerun forcechain=yes products=all
With the default forcechain=no, products=evt skips FSA, exposure and background preparation. products=img can produce images directly from science events without an input image or exposure map. It prepares raw science first when necessary. Use products=evt,img,expo,rate to retain imaging and exposure products while omitting background. Optional merged spectral/source products still require response=yes and the corresponding source inputs.
TWO-STEP EVENT IMAGING
products=reproject prepares one full-energy clean event file per observation on a common sky grid. It retains every event row, energy/channel and detector column, GTI, BADPIX, and other extensions, changing only sky X/Y and the associated table WCS. Cropping and energy selection happen later during binning. This product does not require an auxiliary-file merge or a merged event container. Raw events still require their normal calibration and screening inputs.
# 1. Prepare once (choose the same reference frame for every observation). fxtobsmerge inputmode=events evtfiles=@evt.lst products=reproject outdir=prepared ra=58.15 dec=-73.98 width=2 height=2 pixsize=auto # 2. Reuse the resulting group list for each requested band. # Replace GROUP with the detector/mode/filter directory written by step 1. fxtobsmerge inputmode=events evtfiles=@prepared/merged/GROUP/reprojected_events.lst products=img outdir=soft emin=0.5 emax=2 autoexp=no fxtobsmerge inputmode=events evtfiles=@prepared/merged/GROUP/reprojected_events.lst products=img outdir=hard emin=2 emax=7 autoexp=no
Leaving geometry parameters at auto in step 2 recovers the saved grid from those prepared events. Each observation is binned separately, then identical-grid count images are added. The per-observation images are saved under obs/OBSID/GROUP/event/images/; the stacked counts and images are under merged/GROUP/. An empty energy band produces a zero-count image on that grid.
A single products=img call also performs both steps as needed. Repeating it with the same original events, geometry, and output directory but different energy bounds automatically reuses valid prepared events, even with resume=no. Reuse verifies source, geometry, FITS checksums and the cached file hash. Changed inputs, changed geometry or a damaged cache trigger fresh preparation. Use separate output directories with the prepared event list to keep several bands. The stricter resume=yes contract still requires the full request and manifest to match; it is for an interrupted identical run.
In event-based modes, available events always supply the photon images; existing imgfiles are ignored. The explicit inputmode=images path remains for image-only legacy data, cannot select photon energies, and may reproject input images. To form count-rate images, request products=img,expo,rate and supply appropriate exposure maps or enable their generation; exposure maps still need projection onto the common grid.
Imaging does not extract spectra or generate ARF/RMF files. Use fxtsrcproducts for each observation and fxtspecmerge for compatible existing spectral products. The existing response=yes option is retained for explicit legacy orchestration.
PARTICLE BACKGROUND INPUTS
Each background run requires complete clean FSA event data for every selected observation and a matching non-vignetted exposure map whose FITS header explicitly contains VIGNAPP=False. An ordinary vignetted exposure map is never used as a fallback. The per-observation FSA monitor is accumulated from calibrated EVENTS.PI after applying the clean event GTI, grade 0:12, STATUS all bits zero, and DETX=3:382, DETY=3:382. Raw CHANNEL is not a fallback. Supply the complete FSA event data, without a user source or sky-region crop; removed events cannot be recovered during extraction. The input frame EXPOSURE is preserved; integer monitor counts use POISSERR=T and BACKSCAL=1 as an internal full-FSA convention that fxtbkggen does not use as an IMG area factor. Null, non-finite and out-of-range PI values are excluded and counted in the output HISTORY; fractional PI values are rejected. Set the particle-background energy bounds with bkgemin and bkgemax in keV. In an existing HEASoft environment, run punlearn fxtobsmerge once to refresh the learned parameter file.
With the default normmethod=fsa, each observation is passed to fxtbkggen with FSA normalization and then to fxtbkgmap with its matching non-vignetted exposure map. The merged FSA monitor is a full-selection PHA with integer counts, POISSERR=T, and BACKSCAL=1. This is an internal full-FSA convention; it is not an IMG aperture factor.
With normmethod=imghe, fxtobsmerge extracts one ungrouped, unsubtracted IMG monitor PHA per observation from the explicit heregion. The region must be source-free in the chosen high-energy band; the default band is [9,10) keV and can be changed with hemin/hemax. Each FSA/IMG pair must carry the same screened selection and GTI. The monitor GTIs are normalized to a common time frame and retained in the merged provenance; missing or invalid monitor GTIs are rejected.
Before coaddition, IMG monitors are put on the first monitor's physical particle-area reference and the corresponding FSA exposure. The heregion extraction uses the matching non-vignetted exposure map (VIGNAPP=False): for observation i, A_i is sum(selected exposure-map pixels) * pixel solid angle / event EXPOSURE. This is a time-weighted instrumental particle area, not a photon-vignetting or source-ARF correction; the native SKY grid is 600*600 pixels, and IMG monitor metadata uses BKGREF=360000. The physical area is represented consistently by BACKSCAL*BKGREF*BKGPIXA; the derived value is recorded through BACKSCAL/BKGREF/BKGPIXA. The coaddition factor is f_i=(A_0/A_i)(T_FSA,i/T_IMG,i). Thus img_monitor_merged.pha can contain fractional COUNTS; it carries propagated STAT_ERR and POISSERR=F, while its BACKSCAL identifies the common monitor reference area. Do not obtain this product by an unscaled generic sum of raw monitor PHAs when monitor areas or exposures differ.
The command then makes one fxtbkggen call with infile=fsa_merged.pha and imgspecfile=img_monitor_merged.pha. The FSA-normalized model is retained as particle_bkg_fsa_merged.pha and particle_bkg_fsa_spectra.lst for comparison; the final particle_bkg_merged.pha is IMGHE-normalized. IMGHE is not a hybrid estimator: the FSA amplitude is a diagnostic comparison and is not averaged into the IMG normalization. The final particle model keeps the particle-template BACKSCAL, not the monitor-region BACKSCAL.
IMGHE merging requires one compatible detector, readout mode, filter, grade/selection, channel grid, and time system, together with the same PARTICLEBKG and E2PI calibration identities over the merged observations. Missing or incompatible particle-area metadata, calibration files, or paired FSA/IMG time selections fail the merge. Spatial background maps continue to use the per-observation FSA path; the manifest records particle_map_normmethod=fsa. Shared template and calibration errors may be correlated across observations and channels; marginal STAT_ERR does not encode the full covariance.
When response=yes extracts spectra from several observations,
use source and background regions in FK5/ICRS sky coordinates. The response
workflow extracts from each original observation; image/physical regions from
the merged grid require identical atom X/Y WCS and are rejected if that cannot
be verified. Partial coverage retains the complete aperture normalization;
atoms with no source coverage are recorded and omitted from extraction.
The source, background, and heregion files use the shared
supported DS9/CIAO parser. A headerless shape with sexagesimal-colon or explicit
h/d position units is treated as FK5/J2000 for that
shape; explicit frame or pixel directives retain
precedence. Bare numeric positions remain physical, and inferred celestial
circle/annulus/ellipse/box sizes require explicit angular units. Mixed pixel and
sky position tokens are rejected. Use the documented supported subset rather
than assuming full CIAO region-language coverage.
EXAMPLES
fxtobsmerge inputmode=obs indirlist=@obs.lst outdir=merged ra=58.15 dec=-73.98 width=2 height=2 fxtobsmerge inputmode=events evtfiles=@evt.lst mkffiles=@mkf.lst attfiles=@att.lst orbitfiles=@orb.lst outdir=merged autoexp=yes expenergy=1.5 fxtobsmerge inputmode=events evtfiles=@evt.lst mkffiles=@mkf.lst attfiles=@att.lst orbitfiles=@orb.lst outdir=legacy_screening expr='ELV>5&&COR>6&&SAA==0&&DYE_ELV>30' fxtobsmerge inputmode=obs indirlist=@obs.lst outdir=merged response=yes sources=sources.json fxtobsmerge inputmode=obs indirlist=@obs.lst outdir=soft products=img emin=0.5 emax=2 combine=images fxtobsmerge inputmode=obs indirlist=@obs.lst outdir=combined products=all response=yes sources=sources.json combine=all fxtobsmerge inputmode=obs indirlist=@obs.lst outdir=background products=bkg fxtobsmerge inputmode=obs indirlist=@obs.lst outdir=background products=bkg normmethod=imghe heregion=source_free_img.reg hemin=9 hemax=10
REPROJECTION
Photon images made from events are direct integer-count bins on one shared WCS, added without image reprojection. Exposure maps and the explicit inputmode=images compatibility path are reprojected with quantity-aware area and footprint handling. Integer-aligned grids are copied exactly. Merging products with different scale, rotation, tangent point, or sub-pixel alignment requires the Python reproject package.
For undistorted TAN grids, pixel intersections are computed in the output tangent plane and integrated using their spherical solid angles. Counts use the overlap fraction of each input pixel; exposure uses the overlap fraction of each output pixel. This retains count conservation at the celestial poles and at coincident pixel boundaries. Pixels genuinely outside an explicitly cropped output remain excluded. Other supported projections and SIP distortion use the generic exact-reprojection backend.
EVENT TIME AND COORDINATE FRAME
All merged event and GTI times are converted to seconds relative to the first input MJD reference, with TIMEZERO=0. Inputs must use the same TIMESYS; a cross-system merge is rejected rather than silently converting a time scale. When X/Y frames differ, event coordinates are reprojected to the merged table WCS. Missing or invalid WCS is fatal.
MERGED RESPONSE PROVENANCE
Merged events carry MERGED=T, ASPREQ=T,
ASPVERS=1, the ATOM_INDEX provenance table, and
ATOM_GTI with each native observation's actual GTIs. The public
container GTI is a union, whereas ATOM_GTI preserves per-atom boundaries and
overlaps. First and last event arrivals are not used as native GTI limits.
Merged MKF time columns are normalized to the event time reference and retain
AUX_ID boundaries between native telemetry files.
The event workflow attaches RESPCTX only after the matching
response-context sidecar exists; related exposure products receive that link
as well. Preserve these headers when extracting spectra, for example with
XSELECT extract spectrum copyall=yes. fxtarfgen uses
this provenance to force GTI/aspect handling even
when aspcor=0 is requested. The context and referenced native
event/MKF/BADPIX files remain required. Per-atom spectra remove merge-wide
flags, so they are not incorrectly treated as merged containers.
After relocating a spectrum, preserve its relative RESPCTX link or pass a
validated respctx= path to fxtarfgen. Merged data without
recoverable provenance should be regenerated; a name containing "merged" is
not sufficient evidence. Simultaneously overlapping independent atoms require
per-atom response generation and exposure-aware combination.
GEOMETRY, ENERGY SELECTION AND REUSE
Automatic geometry encloses the event positions and outer image boundaries in the output TAN projection. Images with distortion or another projection require explicit ra, dec, width and height. Footprints crossing the TAN horizon cannot share one automatic grid.
Observation discovery binds exposure products to the selected science-event processing identity. If that exposure is absent, an exposure with a different processing identity is not added to the sum; autoexp=yes can regenerate the missing product from the matching events and MKF.
Full-band merged EVENTS, count images and rate images retain their original selection. Particle-background subtraction creates separate band_counts tiles, selecting calibrated PI with the same CALDB E2PI endpoints as fxtbkgmap. The resulting net counts and net rate cover [bkgemin, bkgemax), recorded in BKGEMIN and BKGEMAX. Empty source-count tiles are retained wherever the background is defined. Calibrated PI and the science event files are required for this subtraction.
dryrun=yes writes fxtobsmerge_plan.json with status planned; it does not create or replace a completed science manifest or precreate the compact output directories. The processing contract is part of the resume identity. Products generated before the current geometry, energy-selection, and DF/FF grouping rules require a fresh run instead of resume.
BADPIX PROVENANCE
Merged BADPIX rows carry OBSIDX, ATOM_ID and zero-based native SRCROW. Identical detector pixels from different observations remain distinct. VALID_START/VALID_STOP and GTI_SRC identify each observation's validity envelope; gaps remain in ATOM_GTI, so the envelope alone is not a continuous good-time interval. Time columns and bounds use the merged time reference. Missing validity is explicitly marked unavailable. The merged table is an audit container; response generation continues to use the original per-atom BADPIX rather than a static union.
MULTI-OBSERVATION ANALYSIS LIMITS
The default response workflow retains native observation dates, GTIs, MKF and BADPIX inputs and generates per-observation responses. Reusing a single response from one observation is not equivalent. A directly extracted merged spectrum does not provide arbitrary epoch-dependent TELDEF/VIGNET/PSF segmentation: use the per-observation workflow when these calibrations differ between epochs. Merged images do not define a single spatially and energy dependent mixed PSF; precise source morphology requires per-observation PSF modeling.
The event X/Y WCS reader uses the standard TCTYP/TCRPX/TCRVL/TCDLT/TCUNI representation. General table rotation matrices or distortions are outside that supported representation. Spacecraft roll changes on a standard north-oriented SKY grid do not by themselves constitute a rotated table WCS.
FXT dead time is treated as negligible (DEADPOL=FIXZERO in source products). GTI duration, partial spatial coverage, vignetting and PSF corrections remain separate quantities and are still applied through their existing paths.
Strict resume verifies CALDB configuration, alias, index and SHA-256 contents of every file referenced by the EP/FXT index, including in-place replacements with unchanged names and sizes. This inventory includes unused indexed files conservatively, but excludes unindexed archives. It records missing historical files without pretending they were selected. Unreadable or incomplete inventories cannot establish strict resume. caldb_policy=warn warns and continues; ignore bypasses this CALDB identity check. This check does not certify which calibration made pre-existing HL inputs. Use forcechain=yes with raw inputs when homogeneous reprocessing is needed.
SEE ALSO
fxtobsmerge, fxtsrcproducts, fxtspecmerge, fxtevtmerge, fxtexpogen, fxtimage, fxtimgmerge
Manual page updated
2026-11-04