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

FXTSoft v2.0 documentation

fxtpsfgen help

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

← Back to Command Reference

NAME

fxtpsfgen -- Generate PSF (Point Spread Function) file for input parameters

USAGE

fxtpsfgen det=fxta filter=thin rawX=192 rawY=189 energy=2000 outfile=psf.fits
fxtpsfgen infile=event.fits ra=284.146 dec=-37.908 energy=2000 outfile=sky_psf.fits
fxtpsfgen psfcontext=response.json ra=284.146 dec=-37.908 imageid=A outfile=composite_psf.fits

DESCRIPTION

'fxtpsfgen' generates PSF (Point Spread Function) files based on detector, filter, position, and energy parameters. The PSF characterizes how a point source of light spreads out in the detector due to the telescope optics and detector response.

The tool retrieves telescope definition information from CALDB, calculates the off-axis angle from the raw detector coordinates, and uses a PSF interpolator to generate a PSF image at the specified location and energy.

Off-axis positions are mapped to the calibrated quadrant when a PSF grid is one-sided, and the resulting image is mirrored back to the requested detector orientation. Linear interpolation uses a containing triangle from the full grid. Positions outside the calibrated domain are rejected; spatial extrapolation is not supported.

The input selects the calculation: infile selects a single-observation sky-coordinate calculation; psfcontext selects a composite response; neither selects the original RAW calculation. The two input selectors are mutually exclusive. New inputs use keyed parameters. The HEASoft mode=ql parameter retains its query/learn meaning.

For a single observation, provide an event or image FITS file and ICRS RA/Dec in degrees. DETNAM, FILTER, RA_PNT, DEC_PNT and PA_PNT are required in its primary/selected extension headers. Image inputs may use the FK5/J2000 WCS written by fxtimage and fxtexpogen; the requested ICRS position is transformed to that grid. The tool projects the source through the existing TELDEF alignment and reference attitude, calls the original monochromatic PSF generator, and then maps the detector PSF onto a sky grid with the reference roll angle. The primary output is a north-up or input-WCS sky-frame PSF, with finite-support flux preserved by local subpixel integration. The original detector-frame PSF is retained in the DETECTOR_PSF extension for audit and RAW-frame reuse. This is a single reference-attitude projection, not a time integration; attitude-varying integration remains a composite-context operation. Explicit merged-observation inputs are rejected. No new CALDB payload is required.

For a composite response, provide the frozen response-context JSON used by fxtsrcdet. The source is evaluated on the selected counts image's common sky grid, using the context's recorded spectrum, PI selection, GTIs, attitude and calibration. The context and its bound files are verified before use. If the context contains more than one image (for example FXTA and FXTB), imageid is required; each image is exported separately. Detector coordinates, detector/filter overrides and a separate energy are not accepted in this mode.

PARAMETER SUMMARY

ParameterDefault / valuesSummary
detrequired in RAWdetector (fxta/fxtb)
filterrequired in RAWfilter (thin/medium/hole)
rawXrequired in RAWzero-based detector X/column
rawYrequired in RAWzero-based detector Y/row
energyrequired in RAW/SKYmonochromatic PSF energy in eV; excluded for COMPOSITE
infileNONEsingle-observation event/image FITS file; selects SKY
rarequired in SKY/COMPOSITEICRS right ascension, 0 <= RA < 360 degrees
decrequired in SKY/COMPOSITEICRS declination, -90 <= Dec <= 90 degrees
psfcontextNONEfrozen response-context JSON; selects COMPOSITE
imageidNONEcontext image identifier; required when several images exist
outfilerequiredthe name of the output psf image file
clobberyes/no; default yesOverwrite an existing output file
verbose1Logging verbosity: 0=warning/error, 1=normal info, 2=debug
modeqlQuery/learn mode

PARAMETERS

det [detector name]
Detector name ('fxta' or 'fxtb').

filter [filter name]
Filter type ('thin', 'medium', or 'hole').

rawX [float]
The rawX position of PSF center.

rawY [float]
The rawY position of PSF center.

energy [float]
The energy value for PSF generation in eV.

outfile [file name]
Name of the output PSF image FITS file.

clobber [yes/no]
Overwrite an existing output file. Default: yes.

infile, ra, dec, psfcontext, imageid
These are explicit per-run inputs and are not learned or replayed from PFILES. Single-observation inputs derive detector and filter from FITS metadata; do not also supply det, filter, rawX or rawY. In composite mode, imageid must exactly match a context image identifier. Input, context and calibration files cannot be used as output targets.

SKY OUTPUT

With a complete ICRS or FK5/J2000 image WCS (RA axis first, Dec axis second), the sky PSF uses that WCS and shifts CRPIX1/2 to the returned finite-support origin. The input WCS frame is retained in the standalone output, and ICRS request coordinates are transformed by Astropy before projection. With no image CTYPE cards, as in an EVENTS-only input, a north-up TAN WCS centred on the requested source is generated at the detector native angular pixel scale. Partial or invalid WCS definitions are rejected. Lookup-table WCS distortions are rejected because their external tables cannot be copied into this standalone product.

The primary HDU has PSFFRAME=SKY, SKYROT=True, SKYINT=False, PSFNORM=FINITE, and records X_SRC/Y_SRC (zero-based source pixel), XORIGIN/YORIGIN (zero-based origin in the source grid), and the roll/TELDEF provenance. The DETECTOR_PSF extension preserves the native detector-frame interpolation with PSFFRAME=DETECTOR and SKYROT=False. Both products retain their FITS checksums; the sky primary is normalized only over the complete finite projected support.

COMPOSITE OUTPUT

The current composite evaluator accepts an ICRS or FK5/J2000 sky WCS with RA on axis 1 and Dec on axis 2. Lookup-table WCS distortions are unsupported; standard celestial projections and header-contained SIP terms are retained.

The output covers the complete finite calibration support, including pixels outside the original counts image. Each image HDU has the shifted sky WCS; X_SRC/Y_SRC and XORIGIN/YORIGIN use zero-based coordinates. No thumbnail normalization is applied.

HDUMeaning
PSF_REFERENCE (primary)K0/G0: reference shape, unit sum over full finite support
PSF_DETECTEDKd/GD: detected shape, unit sum when GD > 0; otherwise all zeros with a quality flag
REFERENCEK0: response before detection losses, in cm2 s
UNITFLUXKd: expected counts per unit reference-band photon flux, in cm2 s
RSP_CONTEXTFrozen context JSON and selected-atom calibration audit

G0 and GD record the full response integrals; CAP_DET=GD/G0. UNITFLUX already includes time and area weighting: multiply by reference-band photon flux to predict counts, without multiplying exposure again. PSFNORM=FINITE describes normalization within the available CALDB support, not a measured infinite PSF wing correction. RSPHASH identifies the frozen context. Every HDU carries FITS checksums.

EXAMPLES

>fxtpsfgen det=fxta filter=thin rawX=192 rawY=189 energy=2000 outfile=fxta_thin_192_189_e2000.fits clobber=yes

>fxtpsfgen fxta thin 192 189 2000 psf_image.fits clobber=yes

BUGS

SEE ALSO

fxteefgen, fxtexpogen, fxtarfgen

Manual page updated

2026-11-04