EP-FXT Science Data Center / Users Guide FXTSoft and CALDB v2.0 release · 2026-11-06

Installation of FXTSoft v2.0

Prerequisites

  • Sufficient disk space for the source, build tree, installed software, and CALDB. Requirements depend on the platform and selected HEASoft packages; consult the HEASoft installation guides for the chosen release.
  • X11 / X Windows:
    Graphical tools such as XSPEC, XIMAGE, FV, and fplot require X11. See X.Org or, on macOS, XQuartz.
  • CPython 3.11 or newer. Use the same interpreter to build and run FXTSoft. The Python tools require NumPy ≥ 1.25, Astropy ≥ 6.1, SciPy ≥ 1.15, Numba ≥ 0.58.1, pandas ≥ 2.0, Matplotlib ≥ 3.7, regions ≥ 0.11, reproject ≥ 0.20, and Pillow ≥ 11. If you use the optional install-fxtsoft-init.py helper, also install PyYAML with python3 -m pip install PyYAML in that environment.

Source-code installation

Ubuntu

The current FXTSoft v2.0 source package is published at https://epfxt.ihep.ac.cn/docs/fxtsoft/downloads/fxtsoft/2.0/. It can be compiled on supported Ubuntu and other Linux systems with the corresponding HEASoft prerequisite packages.

Python requirements

    NumPy >= 1.25
    Astropy >= 6.1
    SciPy >= 1.15
    Numba >= 0.58.1
    pandas >= 2.0
    Matplotlib >= 3.7
    regions >= 0.11
    reproject >= 0.20
    Pillow >= 11

Build and install

  1. Prerequisite packages Before the first installation, install the packages required to build FXTSoft from the source distribution:
        sudo apt-get update && sudo apt-get install -y \
            gcc g++ gfortran make perl libreadline-dev libncurses-dev \
            libx11-dev libxt-dev curl libcurl4-gnutls-dev xorg-dev
  2. Unpacking Unpack the downloaded archive, for example:
        tar zxf fxtsoft_v2.0.tar.gz
    This creates a fxtsoftv2.0/ directory containing the source code. Keep the downloaded archive unchanged so that the unpacked source can be restored if a build must be restarted.
  3. Building Activate the CPython 3.11-or-newer environment you will use to run FXTSoft. Use that interpreter for the build. Replace /path/to/install with your final installation directory.
    python3 -VV
    export PYTHON="$(command -v python3)"
    export FXT_PYTHON="$PYTHON"
    Choose the final installation prefix before running configure. Build and install the software in that prefix, and do not move the installed tree after installation because configuration files contain absolute paths. From the directory containing the unpacked source tree, install the Python packages with the selected interpreter, then configure and build FXTSoft.
        cd fxtsoftv2.0
        "$PYTHON" -m pip install -r fxt/caldb_tools/requirements.txt
        cd BUILD_DIR
        ./configure --prefix=/path/to/install > config.txt 2>&1
        make > build.txt 2>&1
        make install > install.txt 2>&1
  4. Initialization For Bourne-compatible shells, initialize the installed platform directory before running FXT tasks. Replace PLATFORM with the platform directory created by the build.
        export HEADAS="/path/to/install/PLATFORM"
        source "$HEADAS/headas-init.sh"
     
    These settings apply only to the current shell. Add them to your .bashrc file if they should be available in new shells.
        export HEADAS="/path/to/install/PLATFORM"
        alias fxtinit="source $HEADAS/headas-init.sh"
    You can then initialize FXTSoft with the fxtinit command.
  5. Configure CALDB v2.0 CALDB is distributed separately from the software. The formal CALDB v2.0 release page is https://epfxt.ihep.ac.cn/docs/fxtsoft/downloads/caldb/2.0/; download the current archive and its checksum from that page, install or unpack it in a stable location, and set the following variables in the initialized FXTSoft shell:
    export CALDB=/path/to/CALDB_v2.0
    export CALDBCONFIG=$CALDB/caldb.config
    export CALDBALIAS=$CALDB/software/tools/alias_config.fits
    The complete CALDB package includes blank-sky reference observations in data/ep/fxt/bcf/bkg/blanksky.tar.gz. A standard CALDB installation does not require expanding this archive. If the reference events are needed for a background analysis, extract it into a separate working directory. Confirm the installation and local offline help before processing science data:
    fxtcaldb-update command=verify install_root=$CALDB
    fhelp -m=cat -l fxtchain

Note: Do not compile or install the code on an NTFS partition. NTFS does not allow colons (:) in filenames, which can cause the following CFITSIO compilation error: "Can't write-open blib/man3/Astro::FITS::CFITSIO.3pm"

RHEL-compatible Linux (AlmaLinux, Rocky Linux, CentOS Stream)

The current IHEP FXTSoft v2.0 runtime has been verified on AlmaLinux 9.8. On AlmaLinux and other RHEL-compatible RPM-based systems, install the compiler and development packages below, then select CPython 3.11 or newer before configuration:

    sudo dnf install -y gcc gcc-c++ gcc-gfortran make readline-devel \
        ncurses-devel libX11-devel libXt-devel libcurl-devel perl

Rocky Linux and CentOS Stream use the same package family. Then follow the unpacking, Python setup, configuration, build, and installation steps above, using the same source-tree and BUILD_DIR layout.

macOS

On macOS, use a supported Xcode command-line toolchain and a CPython 3.11-or-newer environment. Set PYTHON and FXT_PYTHON to the same interpreter before running configure.

    export PYTHON=/path/to/python3
    export FXT_PYTHON="$PYTHON"

Python requirements

    NumPy >= 1.25
    Astropy >= 6.1
    SciPy >= 1.15
    Numba >= 0.58.1
    pandas >= 2.0
    Matplotlib >= 3.7
    regions >= 0.11
    reproject >= 0.20
    Pillow >= 11

Build and install

Unpack the source archive.

    tar zxf fxtsoft_v2.0.tar.gz

A fxtsoftv2.0 directory containing the source code will be created. Install the dependencies with the interpreter selected for the build:

    cd fxtsoftv2.0
    "$PYTHON" -m pip install -r fxt/caldb_tools/requirements.txt

Configure the software for your platform from the BUILD_DIR directory. The configure script checks for the required libraries, headers, and compilers and generates the Makefile. Set --prefix to the installation directory. Keep the architecture of the compilers, Python, and libraries consistent. Use arch -x86_64 /bin/bash only when intentionally building an Intel-compatible environment with matching dependencies.

    cd BUILD_DIR
    ./configure --prefix=/path/to/install
    make
    make install

FXT installation with an existing HEASoft environment

You can build the FXT component in a separate prefix against a source-built HEASoft installation. Keep its development headers, libraries, and component BUILD_DIR/hmakerc files, along with any build directories they reference. Pass the installed HEASoft platform directory to --with-hea-dir. Use compilers, Python, and HEASoft libraries built for the same architecture.

Select a Python 3.11-or-newer interpreter with the dependencies listed above. Use absolute paths without spaces or shell special characters. The following example starts from a source package containing fxt/BUILD_DIR and fxt/caldb_tools:

export HEADAS=/path/to/heasoft/PLATFORM
. "$HEADAS/headas-init.sh"
export PYTHON=/path/to/python3
export FXT_PYTHON="$PYTHON"
export FXT_DIR=/path/to/fxt-install
cd /path/to/fxt/BUILD_DIR
"$PYTHON" -m pip install -r ../caldb_tools/requirements.txt
./configure --prefix="$FXT_DIR" --with-hea-dir="$HEADAS"
./hmake
./hmake install
. "$FXT_DIR/fxtdas-init.sh"

Check that each command succeeds before proceeding. The installation puts the FXT commands, Python package, help pages, and system parameter files under FXT_DIR. The initialization script preserves HEADAS, CALDB settings, and the user parameter directories, and adds the FXT command, Python, and system parameter paths. Initialize HEASoft followed by fxtdas-init.sh in each shell that will run FXT commands. Configure CALDB separately as described above. The external HEASoft XSELECT mission database must contain the EP/FXT definitions when XSELECT is used; this installation does not modify that database.

command -v fxtpical fxtsrcdet fxtchain
"$FXT_PYTHON" -c \
    'import caldb_tools; print(caldb_tools.__file__)'
fxtsrcdet --help

FXT commands should resolve to FXT_DIR/bin, and the Python package to FXT_DIR/lib/python. Verify compilation, initialization, and the required data-processing workflow on the target operating system and architecture.

Updating the installed Python tools

fxttool-update manages the published caldb_tools component: its Python commands, libraries, system parameter files, and help. CALDB data are managed separately by fxtcaldb-update. After initializing a complete FXTSoft installation, use:

fxttool-update command=status
fxttool-update command=check
fxttool-update command=install
fxttool-update command=verify

For an independent FXT prefix, specify the directory containing bin/, lib/python/caldb_tools/, and syspfiles/:

fxttool-update command=status install_root="$FXT_DIR" layout=single
fxttool-update command=check install_root="$FXT_DIR" layout=single
fxttool-update command=install install_root="$FXT_DIR" layout=single
fxttool-update command=verify install_root="$FXT_DIR" layout=single

status reports local state without network access. check reads remote release metadata and shows the available update without changing installed files. install downloads and verifies the selected release before updating the installed files; dry_run=yes displays the plan without applying it. verify checks files against the recorded installed release. Use command=rollback to return to the previous installed release when available. Repeat commands with the same install_root and layout values. A complete FXTSoft installation uses the standard top-level and FXT platform directories; layout=single is intended for an independent prefix.

Docker installation

Docker provides a containerized runtime for FXTSoft and its software dependencies.

Install Docker Engine before running FXTSoft in a container. Once Docker is ready, obtain the FXTSoft image from the FXTSoft team and import it. Replace fxtsoft-image.tar below with the downloaded filename:

    docker load -i fxtsoft-image.tar

After loading, list the local images with:

    docker images

Start a container from the image name or ID shown by docker images. Replace repository:tag and the host paths below with your local values:

    docker run -v /path/to/CALDB_v2.0:/caldb \
        -v /path/to/input:/input \
        -v /path/to/output:/output \
        -it repository:tag /bin/bash

The -v option mounts a host directory inside the container; the host and container paths are separated by a colon. The example uses three mount points, but fewer can be used when appropriate. Mount the CALDB directory at /caldb when possible, because the container is configured to use that path. If CALDB is mounted elsewhere, update the CALDB environment after starting the container.

The -it option combines interactive mode (-i) with a pseudo-terminal (-t).

On startup, the container executes /bin/bash and opens a shell in which FXT data-reduction tasks can be run.

After leaving a container, find its ID and re-enter it with the commands below. Replace CONTAINER_ID with the value reported by docker ps -a.

    docker ps -a
    docker start CONTAINER_ID
    docker exec -it CONTAINER_ID /bin/bash

If a container is no longer needed, stop and remove it as follows. First save any needed files that are not in a mounted host directory; removing the container deletes its writable layer.

    docker stop CONTAINER_ID
    docker rm CONTAINER_ID