mirror of
https://github.com/nqrduck/nqr-blochsimulator.git
synced 2024-06-30 01:09:08 +00:00
Reverted back to spin factor as setting but keeping calculation.
This commit is contained in:
parent
6643d8833c
commit
8182de30fb
|
@ -18,7 +18,7 @@ class Sample:
|
||||||
resonant_frequency : float,
|
resonant_frequency : float,
|
||||||
gamma : float,
|
gamma : float,
|
||||||
nuclear_spin : float,
|
nuclear_spin : float,
|
||||||
spin_transition : int,
|
spin_factor : float,
|
||||||
powder_factor : float,
|
powder_factor : float,
|
||||||
filling_factor : float,
|
filling_factor : float,
|
||||||
T1 : float,
|
T1 : float,
|
||||||
|
@ -46,13 +46,8 @@ class Sample:
|
||||||
The gamma value of the sample in MHz/T.
|
The gamma value of the sample in MHz/T.
|
||||||
nuclear_spin : float
|
nuclear_spin : float
|
||||||
The nuclear spin quantum number of the sample.
|
The nuclear spin quantum number of the sample.
|
||||||
spin_transition: int
|
spin_factor : float
|
||||||
The spin transition of the sample.
|
The spin transition factor 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
|
|
||||||
powder_factor : float
|
powder_factor : float
|
||||||
The powder factor of the sample.
|
The powder factor of the sample.
|
||||||
filling_factor : float
|
filling_factor : float
|
||||||
|
@ -78,8 +73,7 @@ class Sample:
|
||||||
self.resonant_frequency = resonant_frequency * 1e6
|
self.resonant_frequency = resonant_frequency * 1e6
|
||||||
self.gamma = gamma * 1e6
|
self.gamma = gamma * 1e6
|
||||||
self.nuclear_spin = nuclear_spin
|
self.nuclear_spin = nuclear_spin
|
||||||
self.spin_transition = spin_transition
|
self.spin_factor = spin_factor
|
||||||
self.spin_factor = self.calculate_spin_transition_factor(nuclear_spin, self.spin_transition)
|
|
||||||
self.powder_factor = powder_factor
|
self.powder_factor = powder_factor
|
||||||
self.filling_factor = filling_factor
|
self.filling_factor = filling_factor
|
||||||
self.T1 = T1 * 1e-6
|
self.T1 = T1 * 1e-6
|
||||||
|
|
|
@ -17,8 +17,8 @@ class TestSimulation(unittest.TestCase):
|
||||||
molar_mass=440.3, # g/mol
|
molar_mass=440.3, # g/mol
|
||||||
resonant_frequency=83.56e6, # Hz
|
resonant_frequency=83.56e6, # Hz
|
||||||
gamma=43.42, # MHz/T
|
gamma=43.42, # MHz/T
|
||||||
nuclear_spin= 7 / 2,
|
nuclear_spin= 9 / 2,
|
||||||
spin_transition=2,
|
spin_factor=1.94
|
||||||
powder_factor=0.75,
|
powder_factor=0.75,
|
||||||
filling_factor=0.7,
|
filling_factor=0.7,
|
||||||
T1=83.5, # µs
|
T1=83.5, # µs
|
||||||
|
@ -76,7 +76,7 @@ class TestSimulation(unittest.TestCase):
|
||||||
def test_spin_factor_calculation(self):
|
def test_spin_factor_calculation(self):
|
||||||
|
|
||||||
spin = self.sample.nuclear_spin
|
spin = self.sample.nuclear_spin
|
||||||
transition = self.sample.spin_transition
|
transition = 1
|
||||||
|
|
||||||
spin_factor = self.sample.calculate_spin_transition_factor(spin, transition)
|
spin_factor = self.sample.calculate_spin_transition_factor(spin, transition)
|
||||||
logger.info("Spin factor: " + str(spin_factor))
|
logger.info("Spin factor: " + str(spin_factor))
|
||||||
|
|
Loading…
Reference in a new issue