1 | '''This is a fit to data.nxs using the convolution of a resolution and a DiffRotDiscreteCircle function. |
---|
2 | The data and resolution correspond to an experiment of Octa-Methyl Silsesquioxane molecules |
---|
3 | carried out at 200K |
---|
4 | |
---|
5 | data.nxs is such that the optimized parameters should be: |
---|
6 | |
---|
7 | Intensity = 0.745, Radius = 0.876(Angstroms), Decay = 763.6(pico-seconds) |
---|
8 | |
---|
9 | In DiffRotDiscreteCircle, "N" and "Q " are attributes, not fitting parameters. |
---|
10 | Data corresponds to Q=1.9. This is a fit to methyl rotations, thus N-3 was selected |
---|
11 | |
---|
12 | I chose starting parameters in "fitstring" reasonable far apart from |
---|
13 | the optimal values. Feel free to change this initial guess. |
---|
14 | |
---|
15 | The units for this example are: |
---|
16 | [Intensity] = arbitray units |
---|
17 | [Radius] = Angstroms |
---|
18 | [Decay] = pico-seconds |
---|
19 | [X-values in data.nxs] = micro-eV |
---|
20 | |
---|
21 | ''' |
---|
22 | data = LoadNexus(Filename='/tmp/data.nxs') |
---|
23 | elastic = LoadNexus(Filename='/tmp/resolution.nxs') |
---|
24 | fitstring='(composite=Convolution,FixResolution=true,NumDeriv=true;name=TabulatedFunction,FileName="",Workspace=resolution,Scaling=1;(name=DiffRotDiscreteCircle,N=3,NumDeriv=true,Q=1.9,Intensity=1,Radius=1,Decay=10));name=LinearBackground,A0=0.001,A1=0.0001' |
---|
25 | Fit(Function=fitstring, InputWorkspace='data', CreateOutput=1) |
---|