diff --git a/src/pg_rad/isotopes/isotope.py b/src/pg_rad/isotopes/isotope.py index ea758b8..78ac54e 100644 --- a/src/pg_rad/isotopes/isotope.py +++ b/src/pg_rad/isotopes/isotope.py @@ -1,3 +1,6 @@ +from pg_rad.physics import get_mass_attenuation_coeff + + class Isotope: """Represents the essential information of an isotope. @@ -11,13 +14,14 @@ class Isotope: name: str, E: float, b: float - ): + ): 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)") + raise ValueError("branching_ratio_pg must be a ratio b in [0,1]") self.name = name self.E = E self.b = b + self.mu_mass_air = get_mass_attenuation_coeff(E / 1000)