Esempio n. 1
0
 def test_do_fit(self):
     guess = dict(A0=0.25, Freq=0.55, Sigma=0.25, Phi=0.0)
     target = dict(A0=0.2, Freq=0.5, Sigma=0.2, Phi=0.0)
     do_a_fit(np.arange(0.1, 16, 0.2),
              'GaussBessel',
              guess,
              target,
              atol=0.01)
Esempio n. 2
0
 def test_do_fit(self):
     guess = dict(A0=0.25, Radius=10.5, LambdaTrans=0.25)
     target = dict(A0=0.2, Radius=10, LambdaTrans=0.2)
     do_a_fit(np.arange(0.1, 16, 0.2),
              'ZFelectronDipole',
              guess,
              target,
              atol=0.01)
Esempio n. 3
0
 def test_do_fit(self):
     guess = dict(A0=0.25, FreqA=0.35, FreqD=0.25, FCut=1.05, Phi=0.0)
     target = dict(A0=0.2, FreqA=0.3, FreqD=0.2, FCut=1.0, Phi=0.0)
     do_a_fit(np.arange(0.1, 16, 0.2),
              'ZFMuonium',
              guess,
              target,
              atol=0.01)
 def test_do_fit(self):
     guess = dict(A0=0.25, KTdelta=0.15, B0=11.0, Gauss=0.25)
     target = dict(A0=0.2, KTdelta=0.1, B0=10.0, Gauss=0.2)
     do_a_fit(np.arange(0.1, 16, 0.2),
              'CompositePCRmagnet',
              guess,
              target,
              atol=0.01)
Esempio n. 5
0
 def test_do_fit(self):
     guess = dict(A=1.1, Lambda=0.15, N0=1.1, Tau=5.0, Phi=0.3, Nu=0.2)
     target = dict(A=1.0, Lambda=0.1, N0=1.0, Tau=5.0, Phi=0.3, Nu=0.2)
     do_a_fit(np.arange(0.1, 16, 0.2),
              'MuMinusExpTF',
              guess,
              target,
              atol=0.01)
Esempio n. 6
0
 def test_do_fit(self):
     guess = dict(A0=0.25, Field=0.1, A=1.5, Phi=0.0)
     target = dict(A0=0.2, Field=0.1, A=1.5, Phi=0.0)
     do_a_fit(np.arange(0.1, 16, 0.2),
              'LowTFMuonium',
              guess,
              target,
              atol=0.01)
Esempio n. 7
0
 def test_do_fit(self):
     guess = dict(A0=0.25, SigmaOverW=0.15, H0=3.0, Toff=0.15)
     target = dict(A0=0.2, SigmaOverW=0.1, H0=3.0, Toff=0.1)
     do_a_fit(np.arange(0.1, 16, 0.2),
              'PCRmagnetfnorm',
              guess,
              target,
              atol=0.01)
Esempio n. 8
0
 def test_do_fit(self):
     guess = dict(A0=0.25, Delta=0.15, H0=10.0, Toff=0.15)
     target = dict(A0=0.2, Delta=0.1, H0=10.0, Toff=0.1)
     do_a_fit(np.arange(0.1, 16, 0.2),
              'PCRmagnetZFKT',
              guess,
              target,
              atol=0.01)
Esempio n. 9
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'DampedBessel',
              guess=dict(A0=0.25,
                         Field=10.5,
                         Phi=0.05,
                         LambdaL=0.15,
                         LambdaT=0.15,
                         FractionL=0.15),
              target=dict(A0=0.2,
                          Field=10,
                          Phi=0.0,
                          LambdaL=0.1,
                          LambdaT=0.1,
                          FractionL=0.1),
              atol=0.01)
Esempio n. 10
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'PEARLTransVoigt',
              guess=dict(Position=1096,
                         LorentzianFWHM=45.5,
                         GaussianFWHM=25.4,
                         Bg0=25.2,
                         Bg1=0.017,
                         Bg2=0.0),
              target=dict(Position=1096.3,
                          LorentzianFWHM=45.8,
                          GaussianFWHM=25.227,
                          Bg0=25.0,
                          Bg1=0.015,
                          Bg2=0.0),
              atol=0.01)
Esempio n. 11
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'StandardSC',
              guess=dict(A0=0.5,
                         FieldSC=10,
                         FieldBG=11,
                         Phi=0.05,
                         Sigma=0.2,
                         Abg=0.1),
              target=dict(A0=0.5,
                          FieldSC=10,
                          FieldBG=11,
                          Phi=0.0,
                          Sigma=0.2,
                          Abg=0.1),
              atol=0.01)
 def test_do_fit(self):
     target = dict(A=1.0, R=3.5, L=1.7)
     # we need only one parameter when fitting only one histogram,
     # else we incur in overfitting
     guesses = (dict(A=1.0, R=3.5, L=3.0), dict(A=1.0, R=0.5, L=1.7))
     fixes = (['A', 'R'], ['A', 'L'])
     for (guess, fix) in zip(guesses, fixes):
         status, fit = do_a_fit(np.arange(0.1, 2.2, 0.2),
                                'EISFDiffCylinder', guess=guess, fixes=fix,
                                target=target, atol=0.01)
         if not status:
             msg_p = 'param {} target value was {}, obtained = {}'
             msg = '\n'.join([msg_p.format(*[p, target[p], fit.Function[p]])
                             for p in target])
             self.fail('\n'+msg)
Esempio n. 13
0
 def test_do_fit(self):
     target = dict(A=1.0, R=3.5, L=1.7)
     # we need only one parameter when fitting only one histogram,
     # else we incur in overfitting
     guesses = (dict(A=1.0, R=3.5, L=3.0), dict(A=1.0, R=0.5, L=1.7))
     fixes = (['A', 'R'], ['A', 'L'])
     for (guess, fix) in zip(guesses, fixes):
         status, fit = do_a_fit(np.arange(0.1, 2.2, 0.2),
                                'EISFDiffCylinder',
                                guess=guess,
                                fixes=fix,
                                target=target,
                                atol=0.01)
         if not status:
             msg_p = 'param {} target value was {}, obtained = {}'
             msg = '\n'.join([
                 msg_p.format(*[p, target[p], fit.Function[p]])
                 for p in target
             ])
             self.fail('\n' + msg)
Esempio n. 14
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'RFresonance',
              guess=dict(A0=0.25, Boffset=10.5, B1=10.5, B1GauWidth=0.25),
              target=dict(A0=0.2, Boffset=10, B1=10, B1GauWidth=0.2),
              atol=0.01)
Esempio n. 15
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'TriangleOsc',
              guess=dict(A0=0.5, Freq=1, Phi=0.0),
              target=dict(A0=0.5, Freq=1, Phi=0.0),
              atol=0.01)
Esempio n. 16
0
 def test_do_fit(self):
     guess = dict(A0=0.25, Freq=1.15, ModFreq=0.15, Phi=0.0)
     target = dict(A0=0.2, Freq=1.0, ModFreq=0.1, Phi=0.0)
     do_a_fit(np.arange(0.1, 16, 0.2), 'ModOsc', guess, target, atol=0.01)
Esempio n. 17
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 2.2, 0.2),
              'EISFDiffSphere',
              guess=dict(A=2.0, R=1.0),
              target=dict(A=1.0, R=3.5),
              atol=0.01)
Esempio n. 18
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'StretchedKT',
              guess=dict(A0=0.55, Beta=1.5, Sigma=0.35),
              target=dict(A0=0.5, Beta=2, Sigma=0.3),
              atol=0.01)
Esempio n. 19
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 2.2, 0.2), 'EISFDiffSphere',
              guess=dict(A=2.0, R=1.0),
              target=dict(A=1.0, R=3.5), atol=0.01)
Esempio n. 20
0
 def test_do_fit(self):
     guess = dict(A0=0.25, Delta=0.25, Nu=0.15)
     target = dict(A0=0.2, Delta=0.2, Nu=0.1)
     do_a_fit(np.arange(0.1, 16, 0.2), 'PCRmagRedfield', guess, target, atol=0.01)
Esempio n. 21
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'TFMuonium',
              guess=dict(A0=0.55, Field=5.5, A=605, Phi=0.0),
              target=dict(A0=0.5, Field=5, A=600, Phi=0.0),
              atol=0.01)
Esempio n. 22
0
 def test_do_fit(self):
     guess = dict(A0 = 0.25, Freq = 2.5, Angle = 50.5, Field = 11, Phi = 0.0)
     target = dict(A0 = 0.2, Freq = 2, Angle = 50, Field = 10, Phi = 0.0)
     do_a_fit(np.arange(0.1, 16, 0.2), 'AFMLF', guess, target, atol = 0.01)
Esempio n. 23
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 2.2, 0.2), 'TeixeiraWater',
              guess=dict(Tau=2.0, L=1.0),
              target=dict(Tau=1.0, L=3.5), atol=0.01)
Esempio n. 24
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'SilverBaseline',
              guess=dict(A0=0.15),
              target=dict(A0=0.1),
              atol=0.01)
Esempio n. 25
0
 def test_do_fit(self):
     guess = dict(A0=0.25, Freq=1.2, Angle=50, Sigma=10.5, Phi=0.0)
     target = dict(A0=0.2, Freq=1, Angle=50, Sigma=0.2, Phi=0.0)
     do_a_fit(np.arange(0.1, 16, 0.2), 'AFMZF', guess, target, atol=0.01)
Esempio n. 26
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'StaticLorentzianKT',
              guess=dict(A0=0.2, A=1.1, Field=0.9),
              target=dict(A0=0.2, A=1, Field=1),
              atol=0.01)
Esempio n. 27
0
	def test_do_fit(self):
		guess = dict(A0 = 0.25, R = 0.45, Delta0 = 0.25)
		target = dict(A0 = 0.2, R = 0.4, Delta0 = 0.2)
		do_a_fit(np.arange(0.1, 16, 0.2), 'GauBroadGauKT', guess, target, atol = 0.01)
Esempio n. 28
0
 def test_do_fit():
     do_a_fit(np.asarray([0.01, 0.1, 1.0, 10.0]), 'ChudleyElliot',
              guess=dict(Tau=1.0, L=1.0),
              target=dict(Tau=1.42, L=2.42), atol=0.01)
Esempio n. 29
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 2.2, 0.2),
              'TeixeiraWater',
              guess=dict(Tau=2.0, L=1.0),
              target=dict(Tau=1.0, L=3.5),
              atol=0.01)
Esempio n. 30
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'FmuF',
              guess=dict(A0=0.55, FreqD=0.25, Lambda=0.15, Sigma=0.25),
              target=dict(A0=0.5, FreqD=0.2, Lambda=0.1, Sigma=0.2),
              atol=0.01)
Esempio n. 31
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'Redfield',
              guess=dict(A0=0.2, Hloc=0.1, Tau=0.1),
              target=dict(A0=0.2, Hloc=0.1, Tau=0.1),
              atol=0.01)
Esempio n. 32
0
	def test_do_fit(self):
		do_a_fit(np.arange(0.1, 16, 0.2), 'Meier', guess = dict(A0 = 0.55, FreqD = 0.015, FreqQ = 0.055, Spin = 3.55, Lambda = 0.15, Sigma = 0.25), target = dict(A0 = 0.5, FreqD = 0.01, FreqQ = 0.05, Spin = 3.5, Lambda = 0.1, Sigma = 0.2), atol = 0.01)
Esempio n. 33
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'SpinGlass',
              guess=dict(A0=0.25, Width=0.15, Nu=1.1, Q=0.15),
              target=dict(A0=0.2, Width=0.1, Nu=1, Q=0.1),
              atol=0.01)
Esempio n. 34
0
 def test_do_fit(self):
     do_a_fit(np.arange(0.1, 16, 0.2),
              'CombGaussLorentzKT',
              guess=dict(A0=0.55, Lambda=0.15, Sigma=0.5),
              target=dict(A0=0.5, Lambda=0.1, Sigma=0.2),
              atol=0.01)
 def test_do_a_fit(self):
     do_a_fit(np.arange(0.1, 2.2, 0.2), 'EISFDiffSphereAlkyl',
              guess=dict(A=2.0, Rmin=2.0, Rmax=3.0),
              target=dict(A=1.0, Rmin=0.5, Rmax=6.3), atol=0.01)