Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions libra_toolbox/neutron_detection/activation_foils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
from datetime import datetime
from . import calibration

from dataclasses import dataclass


@dataclass
class CheckSource:
nuclide: calibration.Nuclide
activity_date: datetime.date
activity: float


class ActivationFoil:
nuclide: calibration.Nuclide
mass: float


from . import explicit, settings, calculations
94 changes: 56 additions & 38 deletions libra_toolbox/neutron_detection/activation_foils/calibration.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,57 @@
import datetime
from dataclasses import dataclass
from typing import List

def get_decay_lines(nuclides:list[str])->dict:
""" Creates dictionary of check source data
given a list of check source nuclides. """
# energy is the gamma energy in units of eV
# intensity is the percentage of decays that result in this energy gamma
all_decay_lines = {'Ba133':{'energy':[80.9979, 276.3989, 302.8508, 356.0129, 383.8485],
'intensity':[0.329, 0.0716, 0.1834, 0.6205, 0.0894],
'half_life':[10.551*365.25*24*3600],
'activity_date':datetime.date(2014, 3, 19),
'activity':1 * 3.7e4},
'Co60':{'energy':[1173.228, 1332.492],
'intensity':[0.9985, 0.999826],
'half_life':[1925.28*24*3600],
'actvity_date':datetime.date(2014, 3, 19),
'activity':0.872 * 3.7e4},
'Na22':{'energy':[511, 1274.537],
'intensity':[1.80, 0.9994],
'half_life':[2.6018*365.25*24*3600],
'actvity_date':datetime.date(2014, 3, 19),
'activity': 5 * 3.7e4},
'Cs137':{'energy':[661.657],
'intensity':[0.851],
'half_life':[30.08*365.25*24*3600],
'actvity_date':datetime.date(2014, 3, 19),
'activity':4.66 * 3.7e4},
'Mn54':{'energy':[834.848],
'intensity':[0.99976],
'half_life':[312.20*24*3600],
'actvity_date':datetime.date(2016, 5, 2),
'activity':6.27 * 3.7e4}}
decay_lines = {}
for nuclide in nuclides:
if nuclide in all_decay_lines.keys():
decay_lines[nuclide] = all_decay_lines[nuclide]
else:
raise ValueError(f'{nuclide} not yet added to get_decay_lines()')
return decay_lines

@dataclass
class Nuclide:
"""
Class to hold the information of a nuclide.

Attributes
----------
name :
The name of the nuclide.
energy :
The energy of the gamma rays emitted by the nuclide.
Copy link
Contributor

@cdunn314 cdunn314 May 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The energy of the gamma rays emitted by the nuclide in keV

intensity :
The intensity of the gamma rays emitted by the nuclide. (must sum to 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intensity doesn't need to sum to 1. For example, in Na22, 1.8 photons are emitted per decay due to positron annihilation creating two photons per beta+ particle being emitted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok good point thank you. It needs to be relative to something though no? i guess it's photon per decay?

half_life :
The half-life of the nuclide in seconds.
"""

name: str
energy: List[float]
intensity: List[float]
half_life: float


ba133 = Nuclide(
name="Ba133",
energy=[80.9979, 276.3989, 302.8508, 356.0129, 383.8485],
intensity=[0.329, 0.0716, 0.1834, 0.6205, 0.0894],
half_life=10.551 * 365.25 * 24 * 3600,
)
co60 = Nuclide(
name="Co60",
energy=[1173.228, 1332.492],
intensity=[0.9985, 0.999826],
half_life=1925.28 * 24 * 3600,
)
na22 = Nuclide(
name="Na22",
energy=[511, 1274.537],
intensity=[1.80, 0.9994],
half_life=2.6018 * 365.25 * 24 * 3600,
)
cs137 = Nuclide(
name="Cs137",
energy=[661.657],
intensity=[0.851],
half_life=30.08 * 365.25 * 24 * 3600,
)
mn54 = Nuclide(
name="Mn54",
energy=[834.848],
intensity=[0.99976],
half_life=312.20 * 24 * 3600,
)
9 changes: 0 additions & 9 deletions test/neutron_detection/test_calibration.py

This file was deleted.

Loading