mirror of
https://github.com/gwm17/spspy.git
synced 2024-11-22 18:18:52 -05:00
Compare commits
2 Commits
3971b797d6
...
c866c07abc
Author | SHA1 | Date | |
---|---|---|---|
Gordon McCann | c866c07abc | ||
Gordon McCann | f128974fa7 |
|
@ -13,7 +13,7 @@ class TargetLayer:
|
||||||
thickness: float = 0.0 #ug/cm^2
|
thickness: float = 0.0 #ug/cm^2
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return "".join([f"{global_nuclear_data.get_data(z, a,).prettyIsotopicSymbol}<sub>{s}<\sub>" for z, a, s in self.compound_list])
|
return "".join([f"{global_nuclear_data.get_data(z, a,).prettyIsotopicSymbol}<sub>{s}</sub>" for z, a, s in self.compound_list])
|
||||||
|
|
||||||
#integrate energy loss starting from the final energy and running backwards to initial energy
|
#integrate energy loss starting from the final energy and running backwards to initial energy
|
||||||
#catima does not natively provide this type of method
|
#catima does not natively provide this type of method
|
||||||
|
|
|
@ -7,6 +7,7 @@ import numpy as np
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
INVALID_PEAK_ID: int = -1
|
INVALID_PEAK_ID: int = -1
|
||||||
|
DEG2RAD: float = np.pi / 180.0
|
||||||
|
|
||||||
class PeakType(Enum):
|
class PeakType(Enum):
|
||||||
CALIBRATION = "Calibration"
|
CALIBRATION = "Calibration"
|
||||||
|
@ -58,6 +59,7 @@ class Spanc:
|
||||||
print("Cannot create reaction with non-existant target ", targetName)
|
print("Cannot create reaction with non-existant target ", targetName)
|
||||||
return
|
return
|
||||||
key = f"Rxn{len(self.reactions)}"
|
key = f"Rxn{len(self.reactions)}"
|
||||||
|
params.spsAngle *= DEG2RAD
|
||||||
rxn = Reaction(params, target=self.targets[targetName])
|
rxn = Reaction(params, target=self.targets[targetName])
|
||||||
self.reactions[key] = rxn
|
self.reactions[key] = rxn
|
||||||
|
|
||||||
|
@ -65,7 +67,7 @@ class Spanc:
|
||||||
if rxnName in self.reactions:
|
if rxnName in self.reactions:
|
||||||
rxn = self.reactions[rxnName]
|
rxn = self.reactions[rxnName]
|
||||||
rxn.params.beamEnergy = beamEnergy
|
rxn.params.beamEnergy = beamEnergy
|
||||||
rxn.params.spsAngle = spsAngle
|
rxn.params.spsAngle = spsAngle * DEG2RAD
|
||||||
rxn.params.magneticField = magneticField
|
rxn.params.magneticField = magneticField
|
||||||
|
|
||||||
def add_calibration(self, data: Peak) -> None:
|
def add_calibration(self, data: Peak) -> None:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from .Spanc import Spanc, PeakType
|
from .Spanc import Spanc, PeakType, DEG2RAD
|
||||||
from .Fitter import convert_fit_points_to_arrays, convert_resid_points_to_arrays
|
from .Fitter import convert_fit_points_to_arrays, convert_resid_points_to_arrays
|
||||||
from .ui.MPLCanvas import MPLCanvas
|
from .ui.MPLCanvas import MPLCanvas
|
||||||
from .ui.ReactionDialog import ReactionDialog
|
from .ui.ReactionDialog import ReactionDialog
|
||||||
|
@ -311,7 +311,7 @@ class SpancGUI(QMainWindow):
|
||||||
self.reactionTable.setCellWidget(row, 1, QLabel(str(rxn)))
|
self.reactionTable.setCellWidget(row, 1, QLabel(str(rxn)))
|
||||||
self.reactionTable.setItem(row, 2, QTableWidgetItem(str(rxn.params.beamEnergy)))
|
self.reactionTable.setItem(row, 2, QTableWidgetItem(str(rxn.params.beamEnergy)))
|
||||||
self.reactionTable.setItem(row, 3, QTableWidgetItem(str(rxn.params.magneticField)))
|
self.reactionTable.setItem(row, 3, QTableWidgetItem(str(rxn.params.magneticField)))
|
||||||
self.reactionTable.setItem(row, 4, QTableWidgetItem(str(rxn.params.spsAngle)))
|
self.reactionTable.setItem(row, 4, QTableWidgetItem(str(rxn.params.spsAngle / DEG2RAD)))
|
||||||
self.reactionTable.resizeColumnsToContents()
|
self.reactionTable.resizeColumnsToContents()
|
||||||
self.reactionTable.resizeRowsToContents()
|
self.reactionTable.resizeRowsToContents()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user