diff --git a/spspy/SPSTarget.py b/spspy/SPSTarget.py index 6b456c4..868fd9b 100644 --- a/spspy/SPSTarget.py +++ b/spspy/SPSTarget.py @@ -13,7 +13,7 @@ class TargetLayer: thickness: float = 0.0 #ug/cm^2 def __str__(self) -> str: - return "".join([f"{global_nuclear_data.get_data(z, a,).prettyIsotopicSymbol}{s}<\sub>" for z, a, s in self.compound_list]) + return "".join([f"{global_nuclear_data.get_data(z, a,).prettyIsotopicSymbol}{s}" for z, a, s in self.compound_list]) #integrate energy loss starting from the final energy and running backwards to initial energy #catima does not natively provide this type of method diff --git a/spspy/Spanc.py b/spspy/Spanc.py index debe303..5a2117f 100644 --- a/spspy/Spanc.py +++ b/spspy/Spanc.py @@ -7,6 +7,7 @@ import numpy as np from enum import Enum INVALID_PEAK_ID: int = -1 +DEG2RAD: float = np.pi / 180.0 class PeakType(Enum): CALIBRATION = "Calibration" @@ -58,6 +59,7 @@ class Spanc: print("Cannot create reaction with non-existant target ", targetName) return key = f"Rxn{len(self.reactions)}" + params.spsAngle *= DEG2RAD rxn = Reaction(params, target=self.targets[targetName]) self.reactions[key] = rxn @@ -65,7 +67,7 @@ class Spanc: if rxnName in self.reactions: rxn = self.reactions[rxnName] rxn.params.beamEnergy = beamEnergy - rxn.params.spsAngle = spsAngle + rxn.params.spsAngle = spsAngle * DEG2RAD rxn.params.magneticField = magneticField def add_calibration(self, data: Peak) -> None: