Reverted back to spin factor as setting but keeping calculation.

This commit is contained in:
jupfi 2024-06-04 14:35:37 +02:00
parent 6643d8833c
commit 8182de30fb
2 changed files with 7 additions and 13 deletions

View file

@ -18,7 +18,7 @@ class Sample:
resonant_frequency : float,
gamma : float,
nuclear_spin : float,
spin_transition : int,
spin_factor : float,
powder_factor : float,
filling_factor : float,
T1 : float,
@ -46,13 +46,8 @@ class Sample:
The gamma value of the sample in MHz/T.
nuclear_spin : float
The nuclear spin quantum number of the sample.
spin_transition: int
The spin transition of the sample.
0 is -1/2 -> 1/2
1 is 1/2 -> 3/2
2 is 3/2 -> 5/2
3 is 5/2 -> 7/2
4 is 7/2 -> 9/2
spin_factor : float
The spin transition factor of the sample.
powder_factor : float
The powder factor of the sample.
filling_factor : float
@ -78,8 +73,7 @@ class Sample:
self.resonant_frequency = resonant_frequency * 1e6
self.gamma = gamma * 1e6
self.nuclear_spin = nuclear_spin
self.spin_transition = spin_transition
self.spin_factor = self.calculate_spin_transition_factor(nuclear_spin, self.spin_transition)
self.spin_factor = spin_factor
self.powder_factor = powder_factor
self.filling_factor = filling_factor
self.T1 = T1 * 1e-6

View file

@ -17,8 +17,8 @@ class TestSimulation(unittest.TestCase):
molar_mass=440.3, # g/mol
resonant_frequency=83.56e6, # Hz
gamma=43.42, # MHz/T
nuclear_spin= 7 / 2,
spin_transition=2,
nuclear_spin= 9 / 2,
spin_factor=1.94
powder_factor=0.75,
filling_factor=0.7,
T1=83.5, # µs
@ -76,7 +76,7 @@ class TestSimulation(unittest.TestCase):
def test_spin_factor_calculation(self):
spin = self.sample.nuclear_spin
transition = self.sample.spin_transition
transition = 1
spin_factor = self.sample.calculate_spin_transition_factor(spin, transition)
logger.info("Spin factor: " + str(spin_factor))