Skip to main content

Detector-aware gamma-ray spectrum builder using Geant4 signal pools and measured backgrounds.

Project description

DOI

Isotope Spectrum Builder

Generate detector-aware gamma-ray spectra by combining:

  • Signal events from Geant4 simulations
  • Background events from resampling a real measured background spectrum

Live demo: https://spectrum-builder.streamlit.app

Features

  • Detector selection: NaI(Tl), CZT, HPGe (shown only if datasets exist)
  • Isotope selection (auto-populated from datasets)
  • Binning: 1024 / 2048 / 4096
  • Optional custom energy range ([E_{min}, E_{max}]) in keV
  • Sampling with replacement (supports more events than in the dataset)
  • Normalization:
    • raw counts
    • counts per second (cps)
    • unit-area (Σ = 1)
  • Exports:
    • CSV spectrum
    • PNG image with embedded attribution and isotope name

Installation (local)

python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt
streamlit run app.py


## Installation from PyPI

Spectrum Builder can be installed directly from PyPI:

```bash
pip install spectrum-builder

Then run the web application with

spectrum-builder-app

The batch scripts can be accessed using
-spectrum-builder-batch
-spectrum-builder-sweep

Project details


Download files

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

Source Distribution

spectrum_builder-1.0.5.tar.gz (76.4 MB view details)

Uploaded Source

Built Distribution

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

spectrum_builder-1.0.5-py3-none-any.whl (76.6 MB view details)

Uploaded Python 3

File details

Details for the file spectrum_builder-1.0.5.tar.gz.

File metadata

  • Download URL: spectrum_builder-1.0.5.tar.gz
  • Upload date:
  • Size: 76.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for spectrum_builder-1.0.5.tar.gz
Algorithm Hash digest
SHA256 cbf846054d84f0f27cc4f2026360370a401c4cc26a2a363c8b9a80721e45bc62
MD5 5a4776967b8453eafb55c41a62aea352
BLAKE2b-256 218b6d6805fc28b2cf8280673fc67cd633a3b7a65d41a6296720c271f037b648

See more details on using hashes here.

File details

Details for the file spectrum_builder-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for spectrum_builder-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 133ed1b58264aecba57049d19e813e46be33e10abdd84d31bc5085cbc53c11e0
MD5 c18da3761af47ef4e89477d4b9b66c31
BLAKE2b-256 3df12e1c855daa534a7d1283b7eccc32a21de27e2977089a5e0c60f07051c08e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page