Skip to main content

beamio

Read, write, and convert acquired or modelled radiotherapy beam measurements using a shared NumPy-based data model.

Supported formats

Format Read Write Automatic detection
IBA myQA Accept 6 ASCII (.asc) Yes Yes Yes
SNC SunSCAN/SunDOSE text (.snctxt) Yes Yes Yes
SNC SunDOSE XML (.sncxml) Yes No Yes
RayStation 2025+ measured-curves CSV (.csv, semicolon-delimited) Yes Yes No; use Raystation directly

PTW BEAMSCAN/Mephysto (.mcc) support is planned.

Installation

Requires Python 3.12 or newer. NumPy is installed automatically.

python -m pip install beamio

Read and convert beam data

from beamio.rfa import BeamDataFactory, IBAAccept6
from beamio.tps.raystation import Raystation

# Detect and parse an IBA ASCII or SNC export.
beam = BeamDataFactory.from_file("measurements.asc")
# Or select the reader explicitly:
# beam = IBAAccept6("measurements.asc").parse()

for measurement in beam.measurements:
    print(measurement.type, measurement.energy, measurement.field_size)
    print(measurement.positions, measurement.doses)

# Conversion copies measurements and metadata; save writes the target format.
converted = beam.convert(Raystation)
converted.save("measured_curves.csv")

# RayStation CSV files use the explicit reader.
curves = Raystation("measured_curves.csv").parse()

SNC exports use the same interface:

from beamio.rfa import SNCSunScan

scans = SNCSunScan("measurements.sncxml").parse()  # latest processing layer
scans.save("measurements.snctxt")
scans.convert(Raystation).save("measured_curves.csv")

SNC positions, field sizes, and SSD are converted to millimetres. Sample order, duplicate positions, dose values, and measured XYZ coordinates are preserved. XML can also select an earlier layer with layer="raw" or a layer number.

BeamData provides parse(), save(), and convert(). Each Measurement contains NumPy positions and doses arrays, a MeasurementType, a RadiationType, energy, SSD, field size, scan endpoints, and a metadata dictionary. The shared spatial fields use millimetres. Dose values retain the input scale; conversion does not normalize or calibrate them.

Conversion transfers the shared model and copies metadata, but format-specific writers may use defaults or omit unsupported metadata. In particular, the RayStation writer generates its default file header (including an export time) rather than preserving the input header. IBA parsing removes non-finite sample pairs and sorts and deduplicates positions. Axial start coordinates are rounded to 0.2 mm, with values within 0.2 mm of zero set to zero; diagonal scans retain measured XYZ samples. IBA output rounds coordinates to 0.1 mm. These operations mean that a save is not a byte-for-byte round trip.

Development

python -m venv .venv

Activate the environment with .venv\Scripts\Activate.ps1 in PowerShell or source .venv/bin/activate on macOS/Linux, then run:

python -m pip install -e ".[dev]"
python -m pytest
python -m build
python -m twine check --strict dist/*
python tools/check_dist.py

The tests generate synthetic measurements in temporary directories. CI tests the installed wheel on Linux, Windows, and macOS and rebuilds the wheel from the source distribution. Tests follow the source areas they exercise, with complete conversions under tests/integration.

beamio uses Conventional Commits and Python Semantic Release. Changes merged to main pass CI before automatic versioning, release-note generation, GitHub releases, and PyPI publishing. pyproject.toml is the version source; beamio.__version__ reads the installed distribution metadata.

Documentation

License

GNU General Public License version 2 only (GPL-2.0-only); see LICENSE.

Metadata

Release files for beamio 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beamio 0.2.0
File Size Uploaded Provenance Actions
beamio-0.2.0.tar.gz 55.0 kB With provenance Details for beamio-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for beamio 0.2.0
File Interpreter ABI Platform Actions
beamio-0.2.0-py3-none-any.whl Python 3 none any Details for beamio-0.2.0-py3-none-any.whl

Total release size: 87.6 kB

Release files / beamio-0.2.0.tar.gz

Download URL beamio-0.2.0.tar.gz
Size 55.0 kB
Tags Source
SHA-256 checksum
How to use checksums
755b922987c0cffe7ce1e21e39e9e2295d210e933f99a4b34d472ad96ed1c14e
BLAKE2b-256 checksum
How to use checksums
06d34c958f1ba289a437d0cef89adb8868750de2b00d411473dfc7a9f076eb96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / beamio-0.2.0-py3-none-any.whl

Download URL beamio-0.2.0-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc0e4620617977e591023e2625cabe5e05080b01d8371ac377b8cbddc6e735a7
BLAKE2b-256 checksum
How to use checksums
de6a6e1a021b6f381031433198377ffba614a52fbea4d6ab8f53622df8f492e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for beamio 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for beamio-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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