Ticket #8977: check8977.py

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