1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | |
---|
4 | from bumps.names import * |
---|
5 | from code_lamellar import GpuLamellar |
---|
6 | from code_ellipse import GpuEllipse |
---|
7 | from multisasmodels import SasModel, load_data, set_beam_stop, set_half |
---|
8 | import numpy as np |
---|
9 | |
---|
10 | data = load_data('DEC07282.DAT') |
---|
11 | set_beam_stop(data, 0.0052)#, outer=0.025) |
---|
12 | #set_half(data, 'left') |
---|
13 | |
---|
14 | truth = SasModel(data, GpuEllipse, |
---|
15 | scale=.0011, radius_a=45.265, radius_b=600.8, sldEll=.291e-6, sldSolv=7.105e-6, |
---|
16 | background=8.30161, axis_theta=0, axis_phi=0, |
---|
17 | radius_a_pd=0.222296, radius_a_pd_n=1, radius_a_pd_nsigma=0, |
---|
18 | radius_b_pd=.000128, radius_b_pd_n=1, radius_b_pd_nsigma=0, |
---|
19 | axis_theta_pd=20, axis_theta_pd_n=40, axis_theta_pd_nsigma=3, |
---|
20 | axis_phi_pd=2.63698e-05, axis_phi_pd_n=20, axis_phi_pd_nsigma=0, |
---|
21 | dtype='float') |
---|
22 | |
---|
23 | #model.radius_a.range(15, 1000) |
---|
24 | #model.radius_b.range(15, 1000) |
---|
25 | #model.axis_theta_pd.range(0, 360) |
---|
26 | #model.background.range(0,1000) |
---|
27 | #truth.scale.range(0, 1) |
---|
28 | |
---|
29 | arrayone = truth.theory() |
---|
30 | |
---|
31 | |
---|
32 | lies = SasModel(data, GpuLamellar, scale=0, bi_thick=5, sld_bi=.291e-6, sld_sol=5.77e-6, background=85.23, |
---|
33 | bi_thick_pd= 0.0013, bi_thick_pd_n=5, bi_thick_pd_nsigma=3, dtype='float') |
---|
34 | |
---|
35 | |
---|
36 | #modeltwo.bi_thick.range(0, 1000) |
---|
37 | #modeltwo.scale.range(0, 1) |
---|
38 | #model.bi_thick_pd.range(0, 1000) |
---|
39 | #model.background.range(0, 1000) |
---|
40 | |
---|
41 | |
---|
42 | arraytwo = lies.theory() |
---|
43 | |
---|
44 | |
---|
45 | a = np.add(np.multiply(arrayone, .5), np.multiply(arraytwo, 0)) |
---|
46 | truth.set_result(a) |
---|
47 | |
---|
48 | |
---|
49 | problem = FitProblem(truth) |
---|
50 | |
---|