Skip to main content
https://img.shields.io/pypi/v/trxasviewer.svg?cacheSeconds=300

A PySide6 GUI for visualizing and analyzing Time-Resolved X-ray Absorption Spectroscopy (TrXAS) datasets collected at synchrotron light sources such as the Advanced Photon Source (APS).

Features

Viewer GUI (trxasviewer view)

  • File browser for SPEC-format raw TrXAS scan files with live detection of new scans during acquisition (NFS-safe polling)

  • Interactive 2-D energy–time difference map with crosshair line-cuts and zoom-in ROI

  • Flexible time-binning: linear, logarithmic, or manual multi-level binning

  • Ground-state subtraction: bunch-average or orbital-average methods

  • Kinetics extraction: up to four user-defined energy ROIs with interactive drag handles on the 2-D map, ±1σ error bars from scan-to-scan variance

  • Outlier removal: median absolute deviation (MAD) or standard deviation

  • Multiple output formats: NumPy NPZ, HDF5, OriginLab CSV, PNG/PDF plots

  • Background saving thread — GUI stays responsive during export

Modeler GUI (trxasviewer model)

  • Load kinetics traces exported from the viewer

  • Build arbitrary multi-state kinetic models via an adjacency matrix

  • ODE-based rate-equation fitting with scipy.optimize

  • Parallel multi-start optimization for robust global minimum search

  • SVD decomposition of the difference map

Installation

Via pip (requires Python 3.10+):

pip install trxasviewer

Standalone executable (no Python required): single-file builds for Windows, macOS, and Linux are attached to each GitHub Release:

  • Windows: trxasviewer-<version>-windows.exe

  • macOS: trxasviewer-<version>-macos.dmg (signed and notarized)

  • Linux: trxasviewer-<version>-x86_64.AppImage (make executable with chmod +x before running)

Double-clicking the executable launches the viewer GUI directly; run it from a terminal with a model argument to open the kinetic modeler instead.

Usage

# Open viewer with a raw data folder
trxasviewer view --rawfolder /path/to/data --syncbunch 1820

# Open the kinetic modeler
trxasviewer model

# Use a dedicated NPZ cache folder for faster repeated loading
trxasviewer view --rawfolder /path/to/data --cachefolder /path/to/cache

See trxasviewer view --help for the full list of options.

Scripting / Jupyter

The trxasviewer.core module is fully Qt-free and can be imported in plain Python scripts or Jupyter notebooks without launching the GUI:

from trxasviewer.core import TrXASDataset, TrXASDatasetManager, save_results

dset = TrXASDataset("/path/to/setup-full-00178")
results = dset.get_energy_vs_time(
    target="normalized-GS",
    norm_kwargs={"sync_type": "bunch", "sync_value": 1820,
                 "gs_method": "bunch-average", "gs_value": 5},
    binning_kwargs={"method": "Linear", "lin_num": 5},
)
print(results["diff"].shape)   # (n_energy, n_time)

A full worked example covering single-file loading, multi-file averaging, SVD, plotting, and saving is in examples/analyze_trxas.py.

Development

git clone https://github.com/AdvancedPhotonSource/trxasviewer
cd trxasviewer
pip install -e ".[dev]"
pytest tests/
ruff check src/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trxasviewer-0.6.2.tar.gz (523.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trxasviewer-0.6.2-py3-none-any.whl (107.2 kB view details)

Uploaded Python 3

File details

Details for the file trxasviewer-0.6.2.tar.gz.

File metadata

  • Download URL: trxasviewer-0.6.2.tar.gz
  • Upload date:
  • Size: 523.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trxasviewer-0.6.2.tar.gz
Algorithm Hash digest
SHA256 e6e31046cc37e0a0baeba21df26d1d6de57f73216e1cd80d33a0e18a87983c4e
MD5 105732f505f306ab6d102b924c55dea3
BLAKE2b-256 5b6d197698a4c700701e86e104f3cdf50638bc25c86cdaf28dc892972ac66d27

See more details on using hashes here.

Provenance

The following attestation bundles were made for trxasviewer-0.6.2.tar.gz:

Publisher: autobuild.yml on AdvancedPhotonSource/trxasviewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trxasviewer-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: trxasviewer-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 107.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trxasviewer-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9d73c415750b8ddbb682a8270df99dc7c74536d50748d5b4ba1315d17fe10268
MD5 1ae011208bbd66d54461ce3af75b9228
BLAKE2b-256 035b3af8e23dc6792d858ca2625be926488792756b25c993b369c32ba627df3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for trxasviewer-0.6.2-py3-none-any.whl:

Publisher: autobuild.yml on AdvancedPhotonSource/trxasviewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 files

0.6.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page