TDCR model
Project description
TDCRPy
A Photo-Physical Stochastic Model for Liquid Scintillation Counting
📖 Overview
TDCRPy is a Python package developed and maintained by the BIPM (Bureau International des Poids et Mesures). It estimates detection efficiencies of liquid scintillation counters using the TDCR (Triple to Double Coincidence Ratio) or CIEMAT/NIST methods.
The calculation is based on a photo-physical stochastic model, allowing users to address:
- Complex decay schemes (Beta spectra via BetaShape).
- Radionuclide mixtures.
- Ionization quenching (Birks model).
- Micelle effects in scintillator cocktails.
- Dynamic efficiency evolution over time.
Technical details can be found in:
📦 Installation
TDCRPy requires a standard Python scientific environment.
1. Install Dependencies
You can install the required libraries via pip or conda.
# Using pip
pip install numpy scipy configparser tqdm importlib-resources
# Optional (for visualization and dynamic decay features)
pip install opencv-python radioactivedecay matplotlib
2. Install TDCRPy
pip install TDCRPy
To upgrade to the latest version:
pip install TDCRPy --upgrade
3. Run Tests
Verify the installation by running the unit tests:
python -m unittest tdcrpy.test.test_tdcrpy
⚡ Quick Start
Here is a basic example to estimate detection efficiencies for Co-60 using a symmetric PMT configuration.
import tdcrpy
# --- 1. Define Parameters ---
mode = "eff" # Calculation mode
L = 1.2 # Free parameter in keV^-1
Rad = "Co-60" # Radionuclide
pmf_1 = "1" # Relative fraction (100%)
N = 1000 # Number of Monte Carlo trials
kB = 1.0e-5 # Birks constant in cm keV^-1
V = 10 # Volume of scintillator in mL
# --- 2. Run Calculation ---
result = tdcrpy.TDCRPy.TDCRPy(L, Rad, pmf_1, N, kB, V, mode)
# --- 3. Display Results ---
print(f"Efficiency S (Single): {result[0]:.4f} +/- {result[1]:.4f}")
print(f"Efficiency D (Double): {result[2]:.4f} +/- {result[3]:.4f}")
print(f"Efficiency T (Triple): {result[4]:.4f} +/- {result[5]:.4f}")
print(f"Efficiency D (CIEMAT/NIST): {result[12]:.4f} +/- {result[13]:.4f}")
Calculate Free Parameter from Measured TDCR
If you have an experimental TDCR value ($R_T/R_D$), you can reverse-calculate the free parameter $L$:
TD = 0.9776 # Measured TDCR parameter
result = tdcrpy.TDCRPy.eff(TD, Rad, pmf_1, kB, V)
print(f"Global free parameter L = {result[0]:.4f} keV^-1")
🛠 Advanced Features
Asymmetric PMTs
TDCRPy supports calculations where the quantum efficiency differs between PMTs. Pass a tuple for the free parameter $L$:
# L for (PMT A, PMT B, PMT C)
L = (1.1, 1.3, 1.2)
result = tdcrpy.TDCRPy.TDCRPy(L, "Co-60", "1", 1000, 1.0e-5, 10)
# Efficiencies for specific pairs (AB, BC, AC) are available in the result tuple
print(f"Efficiency AB: {result[6]:.4f}")
Radionuclide Mixtures
Simulate mixtures by providing comma-separated nuclides and their relative fractions.
# Example: 80% Co-60 and 20% H-3
Rad = "Co-60, H-3"
pmf_1 = "0.8, 0.2"
result = tdcrpy.TDCRPy.TDCRPy(L, Rad, pmf_1, N, kB, V)
Dynamic Decay & Efficiency
Combine TDCRPy with radioactivedecay to simulate how efficiency changes as a sample decays (e.g., Mo-99/Tc-99m).
import radioactivedecay as rd
import tdcrpy as td
import numpy as np
# Define inventory
rad_t0 = rd.Inventory({'Mo-99': 1}, 'Bq')
# Decay for 30 hours
rad_t1 = rad_t0.decay(30.0, 'h')
# Calculate current composition for TDCRPy
A_t1 = rad_t1.activities('Bq')
total_activity = sum(A_t1.values())
# Format strings for TDCRPy
nuclides = ", ".join([k for k, v in A_t1.items() if v > 0])
fractions = ", ".join([str(v/total_activity) for k, v in A_t1.items() if v > 0])
# Run simulation
result = td.TDCRPy.TDCRPy(1.0, nuclides, fractions, 1000, 1e-5, 10, "eff")
⚙️ Configuration & Physics
You can customize the underlying physics model using tdcrpy.TDCR_model_lib.
To view current settings:
import tdcrpy as td
td.TDCR_model_lib.readParameters(disp=True)
Common Configurations
| Parameter | Method | Description |
|---|---|---|
| Electron Bins | modifynE_electron(n) |
Integration bins for electrons (default: 1000) |
| Alpha Bins | modifynE_alpha(n) |
Integration bins for alpha particles (default: 1000) |
| Density | modifyDensity(rho) |
Scintillator density in g/cm³ (default: 0.96) |
| Mean Z / A | modifyZ(z), modifyA(a) |
Mean atomic/mass numbers of the cocktail |
| Micelle Effect | modifyMicCorr(bool) |
Activate reverse micelle correction (default: False) |
| Micelle Size | modifyDiam_micelle(d) |
Diameter in nm (default: 2.0) |
| Dead Time | modifyDeadTime(t) |
Extended dead time in µs (default: 10) |
| Coincidence Time | modifyTau(ns) |
Resolving time in ns (default: 50) |
Tutorials
- Use the stochastic model for all nuclides
- Use the analytical model for pure beta emitters
- Modify the parameters of the model
📚 Citations
If you use TDCRPy in your work, please cite the following:
TDCRPy: A python package for TDCR measurements > R. Coulon, J. Hu
Applied Radiation and Isotopes (2024)
DOI: 10.1016/j.apradiso.2024.111518
⚖️ License
This project is licensed under the MIT License.
Copyright © BIPM (Bureau International des Poids et Mesures).
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
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 tdcrpy-2.17.3.tar.gz.
File metadata
- Download URL: tdcrpy-2.17.3.tar.gz
- Upload date:
- Size: 22.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fb36198c2356d1d17717b29c1aff0243028bdd6aec3bbff2de8faa627c43945
|
|
| MD5 |
8c3ce134bc4f441981e73f6804133812
|
|
| BLAKE2b-256 |
340602c2651ef306b59fc2ce2e45b551e3a58aa7a0b59785630711206424080a
|
Provenance
The following attestation bundles were made for tdcrpy-2.17.3.tar.gz:
Publisher:
python-publish.yml on RomainCoulon/TDCRPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tdcrpy-2.17.3.tar.gz -
Subject digest:
0fb36198c2356d1d17717b29c1aff0243028bdd6aec3bbff2de8faa627c43945 - Sigstore transparency entry: 908395799
- Sigstore integration time:
-
Permalink:
RomainCoulon/TDCRPy@29344782358467f5f6cc159e9cb7aa710f2aa2be -
Branch / Tag:
refs/tags/2.17.3 - Owner: https://github.com/RomainCoulon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@29344782358467f5f6cc159e9cb7aa710f2aa2be -
Trigger Event:
push
-
Statement type:
File details
Details for the file tdcrpy-2.17.3-py3-none-any.whl.
File metadata
- Download URL: tdcrpy-2.17.3-py3-none-any.whl
- Upload date:
- Size: 23.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce8ea179752808ffcd78cb063cf738dbb9b8daa4a5a32a1b2dc43c8254816fa5
|
|
| MD5 |
024162b2c20459899990bb51d1efe6c7
|
|
| BLAKE2b-256 |
13ece2f49037ef8d64c8407ee1bd39032a4bb9b966f9664213ff22a2e9f7a7bc
|
Provenance
The following attestation bundles were made for tdcrpy-2.17.3-py3-none-any.whl:
Publisher:
python-publish.yml on RomainCoulon/TDCRPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tdcrpy-2.17.3-py3-none-any.whl -
Subject digest:
ce8ea179752808ffcd78cb063cf738dbb9b8daa4a5a32a1b2dc43c8254816fa5 - Sigstore transparency entry: 908395856
- Sigstore integration time:
-
Permalink:
RomainCoulon/TDCRPy@29344782358467f5f6cc159e9cb7aa710f2aa2be -
Branch / Tag:
refs/tags/2.17.3 - Owner: https://github.com/RomainCoulon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@29344782358467f5f6cc159e9cb7aa710f2aa2be -
Trigger Event:
push
-
Statement type: