| 1 | |
|---|
| 2 | # create a workspace with 3 spectra and a single point in each. x-values of each spctrum are different. |
|---|
| 3 | ws = CreateWorkspace([1,2,3], [0,0,0],[1,1,1],3) |
|---|
| 4 | |
|---|
| 5 | # define a multi-domain function with a single member which is to be applied to 3 domains with indices form 0 to 2. |
|---|
| 6 | fun = 'composite=MultiDomainFunction;name=UserFunction,Formula="x",$domains=(0-2)' |
|---|
| 7 | |
|---|
| 8 | # specify additional spectra using properties InputWorkspace_# and WorkspaceIndex_# |
|---|
| 9 | kwargs = { |
|---|
| 10 | 'MaxIterations':0, |
|---|
| 11 | 'CreateOutput':1, |
|---|
| 12 | 'InputWorkspace_1': ws, |
|---|
| 13 | 'WorkspaceIndex_1': 1, # domain 1 |
|---|
| 14 | 'InputWorkspace_2': ws, |
|---|
| 15 | 'WorkspaceIndex_2': 2, # domain 2 |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | # evaluate the function |
|---|
| 19 | Fit(fun,ws,**kwargs) |
|---|
| 20 | |
|---|
| 21 | # check the output ws_Workspaces: Calc-values should be equal to x-values |
|---|