1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | |
---|
4 | from bumps.names import * |
---|
5 | from Models.code_lamellar import GpuLamellar |
---|
6 | from Models.code_ellipse import GpuEllipse |
---|
7 | from Models.code_cylinder import GpuCylinder |
---|
8 | from multisasmodels import SasModel, load_data, set_beam_stop, set_half |
---|
9 | import numpy as np |
---|
10 | |
---|
11 | data = load_data('December/DEC07238.DAT') |
---|
12 | set_beam_stop(data, 0.0052)#, outer=0.025) |
---|
13 | #set_half(data, 'left') |
---|
14 | |
---|
15 | truth = SasModel(data, GpuCylinder, |
---|
16 | scale=0.08, radius=46, length=719, |
---|
17 | sldCyl=.291e-6, sldSolv=5.77e-6, background=0, |
---|
18 | cyl_theta=90, cyl_phi=0, |
---|
19 | cyl_theta_pd=23, cyl_theta_pd_n=40, cyl_theta_pd_nsigma=3, |
---|
20 | radius_pd=0.1, radius_pd_n=10, radius_pd_nsigma=3, |
---|
21 | length_pd=0.1, length_pd_n=10, length_pd_nsigma=3, |
---|
22 | cyl_phi_pd=0.1, cyl_phi_pd_n=10, cyl_phi_pd_nsigma=3, |
---|
23 | dtype='float') |
---|
24 | |
---|
25 | |
---|
26 | #model.radius_a.range(15, 1000) |
---|
27 | #model.radius_b.range(15, 1000) |
---|
28 | #model.axis_theta_pd.range(0, 360) |
---|
29 | #model.background.range(0,1000) |
---|
30 | #truth.scale.range(0, 1) |
---|
31 | |
---|
32 | arrayone = truth.theory() |
---|
33 | |
---|
34 | |
---|
35 | lies = SasModel(data, GpuCylinder, |
---|
36 | scale=0.08, radius=46, length=719, |
---|
37 | sldCyl=.291e-6, sldSolv=5.77e-6, background=0, |
---|
38 | cyl_theta=90, cyl_phi=0, |
---|
39 | cyl_theta_pd=23, cyl_theta_pd_n=40, cyl_theta_pd_nsigma=3, |
---|
40 | radius_pd=0.1, radius_pd_n=10, radius_pd_nsigma=3, |
---|
41 | length_pd=0.1, length_pd_n=10, length_pd_nsigma=3, |
---|
42 | cyl_phi_pd=0.1, cyl_phi_pd_n=10, cyl_phi_pd_nsigma=3, |
---|
43 | dtype='float') |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | #modeltwo.bi_thick.range(0, 1000) |
---|
48 | #modeltwo.scale.range(0, 1) |
---|
49 | #model.bi_thick_pd.range(0, 1000) |
---|
50 | #model.background.range(0, 1000) |
---|
51 | |
---|
52 | |
---|
53 | arraytwo = lies.theory() |
---|
54 | |
---|
55 | |
---|
56 | a = np.add(np.multiply(arrayone, .08), np.multiply(arraytwo, .08)) |
---|
57 | truth.set_result(a) |
---|
58 | |
---|
59 | |
---|
60 | problem = FitProblem(truth) |
---|
61 | |
---|