mirror of
https://github.com/pim-n/pg-rad
synced 2026-06-17 15:59:35 +02:00
Improve error handling. Add alignment feature for point sources
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user