update isotope lookup to tabular format. Add primary gamma energy to results plotting

This commit is contained in:
Pim Nelissen
2026-03-12 14:32:21 +01:00
parent 09e74051f0
commit 1dc553d2e2
9 changed files with 56 additions and 24 deletions

View File

@ -11,6 +11,7 @@ from pg_rad.exceptions.exceptions import (
InvalidYAMLError
)
from pg_rad.configs import defaults
from pg_rad.isotopes.isotope import get_isotope
from .specs import (
MetadataSpec,
@ -276,7 +277,9 @@ class ConfigParser:
specs: List[PointSourceSpec] = []
for name, params in source_dict.items():
required = {"activity_MBq", "isotope", "position"}
required = {
"activity_MBq", "isotope", "position", "gamma_energy_keV"
}
if not isinstance(params, dict):
raise InvalidConfigValueError(
f"sources.{name} is not defined correctly."
@ -288,7 +291,10 @@ class ConfigParser:
raise MissingConfigKeyError(name, missing)
activity = params.get("activity_MBq")
isotope = params.get("isotope")
isotope_name = params.get("isotope")
gamma_energy_keV = params.get("gamma_energy_keV")
isotope = get_isotope(isotope_name, gamma_energy_keV)
if not isinstance(activity, int | float) or activity <= 0:
raise InvalidConfigValueError(