mirror of
https://github.com/pim-n/pg-rad
synced 2026-02-02 14:33:09 +01:00
Add Isotope object
This commit is contained in:
25
src/pg_rad/isotopes.py
Normal file
25
src/pg_rad/isotopes.py
Normal file
@ -0,0 +1,25 @@
|
||||
class Isotope:
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
E: float,
|
||||
b: float
|
||||
):
|
||||
"""_Represents the essential information of an isotope._
|
||||
|
||||
Args:
|
||||
name (str): _Full name (e.g. Caesium-137)._
|
||||
symbol (str): _Shorthand symbol (e.g. 137Cs or Cs-137)_
|
||||
E (float): _Energy of the primary gamma in keV._
|
||||
b (float): _Branching ratio for the gamma at energy E._
|
||||
"""
|
||||
|
||||
if E <= 0:
|
||||
raise ValueError("primary_gamma must be a positive energy (keV).")
|
||||
|
||||
if not (0 <= b <= 1):
|
||||
raise ValueError("branching_ratio_pg must be a ratio (0 <= b <= 1)")
|
||||
|
||||
self.name = name
|
||||
self.E = E
|
||||
self.b = b
|
||||
Reference in New Issue
Block a user