1 | from bumps.names import * |
---|
2 | |
---|
3 | from sasmodels.data import load_data |
---|
4 | from sasmodels.core import load_model |
---|
5 | from sasmodels.bumps_model import Model, Experiment |
---|
6 | |
---|
7 | # Spherical particle data, not ellipsoids |
---|
8 | sans, usans = load_data('../../sasview/sasview/test/1d_data/latex_smeared.xml') |
---|
9 | usans.qmin, usans.qmax = np.min(usans.x), np.max(usans.x) |
---|
10 | usans.mask = (usans.x < 0.0) |
---|
11 | usans.oriented = True |
---|
12 | #print sans.dxl, usans.dxl |
---|
13 | #import pprint; pprint.pprint(sans.__dict__) |
---|
14 | |
---|
15 | kernel = load_model("ellipsoid") |
---|
16 | |
---|
17 | model = Model( |
---|
18 | kernel, |
---|
19 | scale=0.08, background=0, |
---|
20 | sld=.291, sld_solvent=7.105, |
---|
21 | r_polar=1800, r_polar_pd=0.222296, r_polar_pd_n=0, |
---|
22 | r_equatorial=2600, r_equatorial_pd=0.28, r_equatorial_pd_n=0, |
---|
23 | theta=60, theta_pd=0, theta_pd_n=0, |
---|
24 | phi=60, phi_pd=0, phi_pd_n=0, |
---|
25 | ) |
---|
26 | |
---|
27 | # SET THE FITTING PARAMETERS |
---|
28 | model.r_polar.range(1000, 10000) |
---|
29 | model.r_equatorial.range(1000, 10000) |
---|
30 | model.theta.range(0, 360) |
---|
31 | model.phi.range(0, 360) |
---|
32 | model.background.range(0,1000) |
---|
33 | model.scale.range(0, 10) |
---|
34 | |
---|
35 | |
---|
36 | #cutoff = 0 # no cutoff on polydisperisity loops |
---|
37 | #cutoff = 1e-5 # default cutoff |
---|
38 | cutoff = 1e-3 # low precision cutoff |
---|
39 | M = Experiment(data=usans, model=model, cutoff=cutoff) |
---|
40 | problem = FitProblem(M) |
---|
41 | |
---|