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