Skip to content
NSLS2Public

About

Importable tools for the HEX beamline

Resources

Stars

2 stars

Watchers

7 watching

Forks

Repository files navigation

hextools

CI PyPI - Version

hextools is the data acquisition package for the 27-ID-1 HEX (High Energy Engineering X-ray scattering) beamline at NSLS-II, Brookhaven National Laboratory.

Overview

  • Devices — ophyd-async classes for the beamline's shutters, slits, monochromator, filters, motor stages, and detectors (Kinetix, Phantom, GeRM, Perkin Elmer, Vimba cameras, PandABox).
  • Plans — bluesky plans for tomography, radiography, energy-dispersive (EDXD) and angle-dispersive (XRD) diffraction, and beamline setup (beam mode, energy, motor moves).
  • Collection profile — an IPython startup script that builds the RunEngine, connects every device, and sends data to Tiled.
  • HEX Data Acquisition GUI — a Qt application that generates a form for each plan and runs it either in-process or through the Bluesky Queue Server.
  • Exporters — automatic export of acquired data from Tiled into beamline file formats.

Installation

The project is managed with Pixi, which solves and locks all dependencies, including the conda-only EPICS stack:

git clone https://github.com/NSLS2/hextools.git
cd hextools
pixi install

Python 3.11–3.13 are supported and tested.

Usage

Start an IPython session with the collection profile loaded:

pixi run start            # against real beamline hardware
pixi run start-mock       # against simulated devices

Start the data acquisition GUI:

pixi run hex-gui          # against real beamline hardware
pixi run hex-gui-mock     # against simulated devices

The GUI can also be launched directly, which exposes additional options:

pixi run -e dev python -m hextools.gui [--mock] [--profile NAME] [--queueserver-uri URI] [--history-file PATH]

Queue Server components and the auto-exporter service have their own tasks:

pixi run qs-backend       # start-re-manager
pixi run qs-server        # bluesky-httpserver
pixi run auto-exporter    # Tiled auto-export service

Development

pixi install -e dev

Common tasks:

pixi run tests            # unit tests (excluding GUI)
pixi run gui-tests        # GUI tests, run separately to avoid Qt teardown issues
pixi run all-tests        # run all unit tests
pixi run tests-cov        # run all unit tests with coverage
pixi run lint             # pre-commit (ruff, formatting, import-linter)
pixi run type-check       # pyright

Build the documentation:

pixi run -e docs build-docs           # output in docs/_build/html
pixi run -e docs build-docs true      # live-reloading preview

Documentation

License

BSD 3-Clause. See LICENSE for details.

About

Importable tools for the HEX beamline

Resources

Stars

2 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages