1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | |
---|
4 | import sys |
---|
5 | from bumps.names import * |
---|
6 | from sasmodels.core import load_model |
---|
7 | from sasmodels.bumps_model import Model, Experiment |
---|
8 | from sasmodels.data import load_data, set_beam_stop, set_top |
---|
9 | |
---|
10 | """ IMPORT THE DATA USED """ |
---|
11 | radial_data = load_data('DEC07267.DAT') |
---|
12 | set_beam_stop(radial_data, 0.00669, outer=0.025) |
---|
13 | set_top(radial_data, -.0185) |
---|
14 | |
---|
15 | kernel = load_model("ellipsoid") |
---|
16 | |
---|
17 | model = Model(kernel, |
---|
18 | scale=0.08, |
---|
19 | radius_polar=15, radius_equatorial=800, |
---|
20 | sld=.291, sld_solvent=7.105, |
---|
21 | background=0, |
---|
22 | theta=90, phi=0, |
---|
23 | theta_pd=15, theta_pd_n=40, theta_pd_nsigma=3, |
---|
24 | radius_polar_pd=0.222296, radius_polar_pd_n=1, radius_polar_pd_nsigma=0, |
---|
25 | radius_equatorial_pd=.000128, radius_equatorial_pd_n=1, radius_equatorial_pd_nsigma=0, |
---|
26 | phi_pd=0, phi_pd_n=20, phi_pd_nsigma=3, |
---|
27 | ) |
---|
28 | |
---|
29 | # SET THE FITTING PARAMETERS |
---|
30 | model.radius_polar.range(15, 1000) |
---|
31 | model.radius_equatorial.range(15, 1000) |
---|
32 | model.theta_pd.range(0, 360) |
---|
33 | model.background.range(0,1000) |
---|
34 | model.scale.range(0, 10) |
---|
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=radial_data, model=model, cutoff=cutoff) |
---|
40 | problem = FitProblem(M) |
---|