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

FXTSoft v2.0 documentation

fxtexpogen help

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

← Back to Command Reference

NAME

fxtexpogen -- Extract exposure file for input event FITS file

USAGE

Method 1: fxtexpogen evtfile mkffile outfile 1.5

Method 2: Using interactive method in prompt

Method 3: fxtexpogen evtfile=evtfile mkffile=mkfile outfile=outfile energy=1.5 area_scale=yes

Method 4: fxtexpogen evtfile=evtfile mkffile=mkfile outfile=outfile specweight=1 specfile=model_spectrum.fits area_scale=no

Method 5: fxtexpogen evtfile=evtfile mkffile=mkfile outfile=outfile hires=1 hirescale=10 fovscale=2

Method 6: fxtexpogen evtfile=evtfile mkffile=mkfile outfile=outfile hires=1 projmethod=polygon

DESCRIPTION

fxtexpogen generates exposure maps that account for bad pixels and columns, pointing variations, and telescope vignetting.

The exposure maps are stored as FITS IMAGE extensions in a file. By default (outmode=both), applying the vignetting correction to the raw instrument map using the vignetting CALDB file writes both the vignetting corrected map at outfile and a non-vignetted companion. Set outmode=vign to compute and write only outfile, or outmode=novign to compute and write only the companion. Single-map modes skip construction, bad-pixel masking, and sky projection for the unselected map.

The non-vignetted companion inserts -without_vign before the final suffix: map.fits becomes map-without_vign.fits, map becomes map-without_vign, and map.v1.fits becomes map.v1-without_vign.fits. The same spectrum weights and effective-area scaling apply in all output modes.

With polygon projection, outmode=both shares each detector-pixel polygon's overlap-area calculation between the vignetting and non-vignetted maps. Each map retains its own weights and accumulation order. Single-map modes continue to project only the requested map.

The command can group similar attitudes to reduce computation time, generate spectrum-weighted exposure maps with specweight=1, and use a high-resolution or enlarged-field sky projection with hires=1.

The default 600 by 600 map integrates detector-pixel polygon overlaps as exposure intensity. Each bad RAW pixel masks a clipped 3 by 3 or 5 by 5 neighborhood before projection, selected by badpixsize=auto from the recorded STATUS screening. STATUS==b0 rejects both the inner 3 by 3 neighbor flag (0x20) and the outer 5 by 5 ring flag (0x40), so it uses 5 by 5. STATUS==b000000000x000000 ignores the outer ring and uses 3 by 3. For a bad column (TYPE=2), the selected neighborhood is applied to every pixel in YEXTENT. There is no second SKY dilation; rotation, partial coverage and attitude changes can spread the footprint across more SKY pixels.

Input event WCS must be an unrotated TAN grid with TCDLT7<0 and TCDLT8>0. Unsupported axis signs, rotation or distortion are rejected. Output WCS is rebuilt without stale template CD/PC/CROTA or distortion cards.

GTI START/STOP and MKF TIME values are interpreted with their column units, TIMEUNIT, TIMEZERO, and absolute MJD reference when present, then integrated on a common seconds axis. Relative inputs without an MJD reference remain supported when their TIMESYS agrees; incompatible relative time scales are rejected. Output exposure maps declare TIMEUNIT=s and TIMEZERO=0. Before attitude sampling, event GTIs are intersected with continuous MKF coverage. Gaps longer than max(60 seconds, 10 times the median positive cadence) split each MKF/AUX_ID segment; no interpolation crosses these gaps or AUX_ID boundaries. All covered positive-duration portions are retained. Nonempty input GTIs with no covered duration are rejected; genuinely empty input GTIs retain the empty-map path. The input event file is never modified.

Output cards GTIIN, GTIUSE, and GTIDROP record the input, integrated, and excluded GTI durations in seconds, also recorded in HISTORY. ONTIME, EXPOSURE, and LIVETIME retain their input event values. GTIUSE describes attitude/exposure-map integration coverage; it is not a deadtime-corrected exposure or a sum of image pixel values.

PARAMETER SUMMARY

ParameterDefault / valuesSummary
evtfilerequiredThe input event file
mkffilerequiredThe mkf file
outfilerequiredThe output exposure map file
energy1.5the average energy for generating exposure map
specweight0Use spectrum-weighted exposure map (0/1)
hires0Use high-resolution and/or enlarged-FOV sky projection (0/1)
hirescale1.0Sky-pixel resolution scale; pixel size is divided by hirescale when hires=1
fovscale1.0Sky field-of-view scale; RA/Dec width is multiplied by fovscale when hires=1
projmethodbilinearHigh-resolution method; noninteger hirescale uses polygon
area_scalenoWhether to apply scaling to the effective area (yes/no)
edgecovermask0mask edge occluded range for merging
clobberyesOverwrite existing output file (if outfile!=NONE)?(yes/no)
use_clusteringyesUse clustering to accelerate computation (yes/no)
ra_threshold2.0RA/DEC angular distance threshold for clustering (arcsec)
pa_threshold0.01Roll angle difference threshold for clustering (deg)
specfilerequired when specweight=1Spectrum file for spectrum weighting; use NONE explicitly to weight by event energies
speccolENGEnergy column used when specweight=1 and specfile is empty
emin0.3Lower energy limit in keV for spectrum weighting
emax10.0Upper energy limit in keV for spectrum weighting
badpixsizeautoRAW bad-pixel mask width: auto from recorded STATUS screening or explicit 3/5
verbose1Logging verbosity: 0=warning/error, 1=normal info, 2=debug
outmodebothboth: compute and write both maps; vign: compute only the vignetting map; novign: compute only the non-vignetted map (case-insensitive)
modeqlQuery/learn mode

PARAMETERS

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

mkffile [file name]
Name of mkf FITS file.

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

(energy=1.5) [float]
Finite positive energy value for vignetting calculation, in unit of keV. This parameter is used when specweight=0. If it is below the first CALDB vignetting energy node, the task uses the vignetting at that first node.

(specweight=0) [integer]
Whether to generate a spectrum-weighted exposure map. Use 0 for the legacy mono-energy calculation and 1 for spectrum weighting.

(hires=0) [integer]
Whether to use the high-resolution/enlarged-field sky projection. Use 0 for the 600 by 600 area-overlap projection and 1 to enable hirescale and fovscale.

(hirescale=1.0) [float]
Resolution scale used when hires=1. The output sky pixel size is the legacy pixel size divided by hirescale. For example, hirescale=10 makes the output sky pixels ten times smaller in RA/Dec.

(fovscale=1.0) [float]
Field-of-view scale used when hires=1. The output RA/Dec width and height are multiplied by fovscale. For example, fovscale=2 covers twice the RA/Dec width and twice the RA/Dec height of the legacy exposure map.

(projmethod=bilinear) [string]
High-resolution projection method used when hires=1. Supported values are bilinear and polygon. For integer hirescale, bilinear is a fast centre-sampling approximation with a centred footprint kernel and boundary padding; it is not an exact rotated-footprint calculation. Noninteger scales automatically use polygon to avoid rounded-kernel exposure errors. polygon integrates detector-footprint overlap areas and is the reference method. With hires=0, polygon is always used. The log and FITS PROJMETH record the method actually used.

Even with integer hirescale, a TELDEF detector pixel can span a noninteger number of event SKY pixels. If the physical footprint differs from the fast kernel width, the task also switches to polygon; this prevents a global exposure-normalisation bias.

(area_scale=no) [string]
Whether to apply scaling to the effective area based on energy-dependent ARF values. In mono-energy mode this uses the ARF value at energy. In spectrum-weighted mode this uses the spectrum-weighted ARF curve. With area_scale=no, the output unit is seconds; with successful area_scale=yes, the output unit is cm**2 * s and AREAFAC records the applied scalar effective area in cm2. fxtarfgen uses that value to recover exposure seconds for ARF weighting. If ARF selection, reading, interpolation, or energy coverage fails while scaling is requested, the task stops by default.

(badpixsize=auto) [string]
RAW bad-pixel mask width: auto, 3, or 5. Automatic selection reads STATUS data-subspace cards (DSTYPn/DSVALn) and complete XSELECT/ftselect parameter HISTORY blocks in all input HDUs, including BADPIX. It supports zero-valued STATUS equalities and 16-bit zero/x masks, optionally joined by AND. All direct bad-pixel flags and the inner-ring flag must be excluded. When a nonempty BADPIX table has no usable selection record, or the selection cannot be represented by a uniform 3 by 3 or 5 by 5 mask, automatic mode retains the legacy 3 by 3 mask and emits a warning. Both maps record BPSRC=FALLBACK, BPREASON and a detailed HISTORY message. Explicitly set badpixsize=3 or badpixsize=5 when the event screening is known. Remaining event STATUS values are never used to guess the selection. Both output maps record BADPSIZE, BPMODE, BPSRC and the interpreted selection in HISTORY.

(outmode=both) [string]
Select which exposure maps to compute and write. The unselected map is not constructed or projected. both writes the vignetting map at outfile and the non-vignetted companion; vign writes only outfile; and novign writes only the companion. Values are case-insensitive. The companion inserts -without_vign before the final suffix. The same spectrum weights and effective-area scaling apply in all output modes.

(edgecovermask=0) [integer]
Mask edge occluded range for merging.

(clobber=yes) [string]
If 'clobber'=yes and outfile=filename, the file with the same name will be overwritten, if it exists.

(use_clustering=yes) [string]
Use clustering to accelerate computation. When set to 'yes', similar attitudes will be grouped to reduce computation time.

(ra_threshold=2.0) [float]
RA/DEC angular distance threshold for clustering in arcseconds. Only applicable when use_clustering=yes.

(pa_threshold=0.01) [float]
Roll angle difference threshold for clustering in degrees. Only applicable when use_clustering=yes.

(specfile) [file name]
Input spectrum file required when specweight=1. Supported inputs are PHA spectra with RESPFILE pointing to an RMF EBOUNDS extension, or simple FITS spectrum tables with ENERGY or ENERG_LO/ENERG_HI plus WEIGHT, FLUX, COUNTS, or RATE. Use specfile=NONE explicitly to weight by the event-file energy column.

Energy column units are converted to keV; absent energy units and the historical FXT EVENTS.ENG label energy retain the keV convention and are recorded as assumptions in HISTORY. The FXT spelling KeV is also accepted. FLUX requires an explicit photon-flux or energy-flux unit; energy-density weights require bin edges and are integrated using bin widths. Photon and energy weighting are distinguished in HISTORY: energy flux is not silently converted to photon flux. Unitless arbitrary weights should use WEIGHT. Event energies and PHA counts/rates are empirical weights, not an unfolded incident spectrum. Choose an incident photon model when that is the intended weighting.

Mono-energy and spectral calculations use the same linear interpolation of vignetting response between calibration nodes. Requested energies below the first or above the last CALDB node use the vignetting at the nearest endpoint. No energy extrapolation is performed. Area scaling still evaluates the ARF at the actual spectral sample energies before averaging. Empty spectral bands and non-finite energies remain errors. ARF coverage is additionally required for area_scale=yes.

(speccol=ENG) [string]
Energy column used when specweight=1 and specfile=NONE.

(emin=0.3) [float]
Lower energy limit in keV for spectrum weighting. Contributing samples below the first CALDB vignetting node use that node's vignetting.

(emax=10.0) [float]
Upper energy limit in keV for spectrum weighting.

EXAMPLES

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=map.fits outmode=both
Writes map.fits and map-without_vign.fits (the default).

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=map.fits outmode=vign
Writes only the vignetting map map.fits.

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=map.fits outmode=novign
Writes only the non-vignetted map map-without_vign.fits.

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=outfile energy=1.5 area_scale=yes

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=outfile specweight=1 specfile=model_spectrum.fits area_scale=no

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=outfile specweight=1 specfile=NONE speccol=ENG emin=0.5 emax=8.0

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=outfile hires=1 hirescale=10 fovscale=1

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=outfile hires=1 hirescale=1 fovscale=2

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=outfile hires=1 projmethod=polygon

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=outfile specweight=1 specfile=source.pha hires=1 hirescale=2 fovscale=2

>fxtexpogen evtfile=evtfile mkffile=mkffile outfile=outfile use_clustering=yes ra_threshold=1.5 pa_threshold=0.02

FILTER METADATA

TELDEF and ARF lookup accept integer or string FITS FILTER values, treating 1 and '01' identically and retaining complete multi-digit codes. Mixed FILTER=MULTIPLE and invalid markers such as E produce an explicit error. Generate exposure maps separately for each filter before merging. ARF-selection errors during area scaling retain the underlying FILTER diagnostic.

BUGS

SEE ALSO

fxtarfgen, fxtpsfgen, fxteefgen

Manual page updated

2026-11-04