Ticket #8624: test_ticket_8624.py

File test_ticket_8624.py, 1.1 KB (added by Jose Borreguero, 7 years ago)

do fits to lorentzian and gaussian

Line 
1# Ticket 8624, branch feature/8624_improve_time_sampling_stExFT
2# (note: hbar = 0.658211626 meV * THz )
3# Fitting parameters to test:
4#
5# The lorentzian structure factor has HWMW = 0.013meV. After the fitting, the
6# tau parameter should be: tau = hbar / HWMW = 50.63166352pico-seconds. It's OK if the result
7# is off by a few percent
8#
9# The Gaussian structure factor has sigma = 0.047meV. After the fitting, the
10# tau parameter should be: tau = sqrt(2) * hbar / HWMW = 19.805357618pico-seconds. It's OK if the result
11# is off by a few percent
12#
13workdir = '/tmp'
14
15LoadAscii( Filename = '{0}/lorentzian1.dat'.format(workdir), OutputWorkspace = 'lorentzian' )
16fit_string = 'name=StretchedExpFT,height=0.1,tau=10.0,beta=1.0,ties=(beta=1.0)'
17Fit( fit_string, InputWorkspace = 'lorentzian', CreateOutput = 1 ) #check workspace lorentzian_Parameters
18
19LoadAscii( Filename = '{0}/gaussian1.dat'.format(workdir), OutputWorkspace = 'gaussian' )
20fit_string = 'name=StretchedExpFT,height=0.1,tau=10.0,beta=2.0,ties=(beta=2.0)'
21Fit( fit_string, InputWorkspace = 'gaussian', CreateOutput = 1 ) #check workspace gaussian_Parameters