1 | Load(r'C:\Users\hqs74821\Work\mantid\Test\AutoTestData\MUSR00015189.nxs',OutputWorkspace='musr') |
---|
2 | inputWS = 'musr_1' |
---|
3 | nHist = 3#mtd[inputWS].getNumberHistograms() |
---|
4 | outNm = 'output' #getWSprefix(inputWS) + 'fury' |
---|
5 | f1 = """( |
---|
6 | composite=CompositeFunction,$domains=i; |
---|
7 | name=LinearBackground,A0=0,A1=0,ties=(A1=0); |
---|
8 | name=UserFunction,Formula=Intensity*exp(-(x/Tau)^Beta),Intensity=1.0,Tau=0.1,Beta=1;ties=(f1.Intensity=1-f0.A0) |
---|
9 | ); |
---|
10 | """#.replace('$WORKSPACE$',inputWS) |
---|
11 | func= 'composite=MultiDomainFunction,NumDeriv=1;' |
---|
12 | ties='ties=(' |
---|
13 | kwargs = {} |
---|
14 | for i in range(0,nHist): |
---|
15 | func+=f1 |
---|
16 | if i > 0: |
---|
17 | ties += 'f' + str(i) + '.f1.Beta=f0.f1.Beta' |
---|
18 | if i < nHist-1: |
---|
19 | ties += ',' |
---|
20 | kwargs['InputWorkspace_' + str(i)] = inputWS |
---|
21 | kwargs['WorkspaceIndex_' + str(i)] = i |
---|
22 | |
---|
23 | ties+=')' |
---|
24 | func += ties |
---|
25 | logger.notice(func) |
---|
26 | logger.notice(str(kwargs)) |
---|
27 | Fit(Function=func,InputWorkspace=inputWS,WorkspaceIndex=0,Output=outNm,Minimizer='Levenberg-MarquardtMD,Debug=1',**kwargs) |
---|