Improve error handling. Add alignment feature for point sources

This commit is contained in:
Pim Nelissen
2026-03-03 21:01:51 +01:00
parent 7612f74bcb
commit 1c8cc41e3c
5 changed files with 113 additions and 26 deletions

View File

@ -1,5 +1,6 @@
from abc import ABC
from dataclasses import dataclass
from typing import Literal
@dataclass
@ -42,31 +43,32 @@ class CSVPathSpec(PathSpec):
@dataclass
class SourceSpec(ABC):
class PointSourceSpec(ABC):
activity_MBq: float
isotope: str
name: str
@dataclass
class AbsolutePointSourceSpec(SourceSpec):
class AbsolutePointSourceSpec(PointSourceSpec):
x: float
y: float
z: float
@dataclass
class RelativePointSourceSpec(SourceSpec):
class RelativePointSourceSpec(PointSourceSpec):
along_path: float
dist_from_path: float
side: str
z: float
alignment: Literal["best", "worst"] | None
@dataclass
class DetectorSpec:
name: str
eff: float | None
efficiency: float
is_isotropic: bool
@ -76,5 +78,5 @@ class SimulationSpec:
runtime: RuntimeSpec
options: SimulationOptionsSpec
path: PathSpec
point_sources: list[SourceSpec]
point_sources: list[PointSourceSpec]
detector: DetectorSpec