-
Notifications
You must be signed in to change notification settings - Fork 8
Activation foil classes #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
ecc757d
383703a
4ca727d
3cb53d2
e6ec09e
b5432e9
1681225
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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. | ||
| intensity : | ||
| The intensity of the gamma rays emitted by the nuclide. (must sum to 1) | ||
|
||
| 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, | ||
| ) | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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