Skip to main content
https://img.shields.io/pypi/v/trxasviewer.svg

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

pip install trxasviewer

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.1.tar.gz (519.3 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.1-py3-none-any.whl (105.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for trxasviewer-0.6.1.tar.gz
Algorithm Hash digest
SHA256 b41b4ef615100370a819e16407fb90731904ec497be5cd7ce760e977d0911105
MD5 02096e788c3096b0aadc5d819092461d
BLAKE2b-256 f4b9cab81e757c3fb9aad9e2609e68596bbdbba8210759384d0c839e480719b5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for trxasviewer-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3e8dbdac6925c6f41fa1e953d54ddcb7272b52c5a9ec99b691ff512c839f124
MD5 6182c3c67bca4589a590a484c66a8c3a
BLAKE2b-256 ca8f7ea3441c9d13e4dffb7fabff758d4d9fc52b3bd97eec502d7fdcc10b750c

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.2

2 files

This release

0.6.1 This release

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