Detector-aware gamma-ray spectrum builder using Geant4 signal pools and measured backgrounds.
Project description
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
Project details
Release history Release notifications | RSS feed
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.3.tar.gz
(76.4 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spectrum_builder-1.0.3.tar.gz.
File metadata
- Download URL: spectrum_builder-1.0.3.tar.gz
- Upload date:
- Size: 76.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8463f92ef2001cacc156d5120ca95f6bd3209d1941376161876cf7769a9f67c6
|
|
| MD5 |
6823feb78260ed099919b2cfbb2c3479
|
|
| BLAKE2b-256 |
e948191c2d11d85b00c69209ac2a3b1f0943a6d30c326cec47d93ac23dc8005e
|
File details
Details for the file spectrum_builder-1.0.3-py3-none-any.whl.
File metadata
- Download URL: spectrum_builder-1.0.3-py3-none-any.whl
- Upload date:
- Size: 76.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1c36b6823ea35387935f5c5ec4e76b3226eb7d5ecd2e74aa0c5c1c2e5635a58
|
|
| MD5 |
f5669821790f59807f581d39efbaa7dc
|
|
| BLAKE2b-256 |
6f099726b385a1ac9724f072b5dcaa5345e8f0fc06a33a0fff54dd1b25e0aa3f
|