Ticket #9011: check9011.py

File check9011.py, 1.1 KB (added by Gesner Passos, 7 years ago)

Script to show fitting in CalculateTransmission

Line 
1import ISISCommandInterface as ici
2import math
3MASKFILE = FileFinder.getFullPath('MaskSANS2DReductionGUI.txt')
4   
5ici.SANS2D()
6ici.MaskFile(MASKFILE)
7ici.TransFit('LOG')
8ici.AssignSample('22048')
9ici.TransmissionSample('22041','22024')
10reduced = ici.WavRangeReduction()
11
12# apply ln
13log_natural = Logarithm('22041_trans_sample_1.5_12.5_unfitted', Natural=True)
14# fit
15Fit(Function='name=LinearBackground',InputWorkspace=log_natural,Minimizer='Levenberg-MarquardtMD',CreateOutput='1',Output='linear_background',StartX='1.5',EndX='12.5')
16fitted_log_values = ExtractSingleSpectrum('linear_background_Workspace', 1)
17# apply exp()
18fit_lognatural_values = Exponential(fitted_log_values)
19
20
21# apply log10
22log_10 = Logarithm('22041_trans_sample_1.5_12.5_unfitted', Natural=False)
23Fit(Function='name=LinearBackground',InputWorkspace=log_10,Minimizer='Levenberg-MarquardtMD',CreateOutput='1',Output='linear_background',StartX='1.5',EndX='12.5')
24fitted_log10_values = ExtractSingleSpectrum('linear_background_Workspace', 1)
25# apply pow(10) => exp(ln10*x)
26fitted_log_values = math.log(10) * fitted_log10_values
27fit_log_values = Exponential(fitted_log_values)
28
29
30