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