gluex-lumi-py

Crates.iogluex-lumi-py
lib.rsgluex-lumi-py
version0.1.5
created_at2025-12-18 17:06:05.222856+00
updated_at2026-01-22 18:33:09.343126+00
descriptionPython bindings for the gluex-lumi Rust crate
homepagehttps://github.com/denehoffman/gluex-rs
repositoryhttps://github.com/denehoffman/gluex-rs
max_upload_size
id1992890
size49,165
Nathaniel D. Hoffman (denehoffman)

documentation

README

gluex-lumi (Python)

Python bindings for the GlueX luminosity calculators. The package exposes get_flux_histograms from the Rust crate and an entrypoint for the gluex-lumi CLI. Use --plot=path.png to save a matplotlib figure when running from the CLI.

Installation

Add to an existing Python project:

uv pip install gluex-lumi

or install as a CLI tool:

uv tool install gluex-lumi

To write a plot image from the CLI:

gluex-lumi --plot=flux.png --run f18=0 --bins=40 --coherent-peak --polarized \
  --rcdb=rcdb.sqlite --ccdb=ccdb.sqlite --min=8.0 --max=9.0

Example

import gluex_lumi as lumi

edges = [7.5 + 0.05 * i for i in range(21)]
histos = lumi.get_flux_histograms(
    {"f18": None}, # uses current timestamp rather than REST version
    edges,
    coherent_peak=True,
    rcdb="/data/rcdb.sqlite",
    ccdb="/data/ccdb.sqlite",
    exclude_runs=[50000, 50001],
)

luminosity = histos.tagged_luminosity.as_dict()
print("bin edges:", luminosity["edges"])
print("counts:", luminosity["counts"])

License

Dual-licensed under Apache-2.0 or MIT.

Commit count: 77

cargo fmt