1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | |
---|
4 | from bumps.names import * |
---|
5 | from sasmodel import SasModel, load_data, set_beam_stop, set_half, set_top |
---|
6 | from Models.code_capcyl import GpuCapCylinder |
---|
7 | from Models.code_coreshellcyl import GpuCoreShellCylinder |
---|
8 | from Models.code_cylinder import GpuCylinder, OneDGpuCylinder |
---|
9 | from Models.code_ellipse import GpuEllipse |
---|
10 | from Models.code_lamellar import GpuLamellar |
---|
11 | from Models.code_triaxialellipse import GpuTriEllipse |
---|
12 | |
---|
13 | """ IMPORT THE DATA USED """ |
---|
14 | #data = load_data('December/Tangential/Sector0/DEC07133.ABS') |
---|
15 | data = load_data('December/DEC07102.DAT') |
---|
16 | |
---|
17 | """ SET INNER BEAM STOP, OUTER RING, AND MASK HALF OF THE DATA """ |
---|
18 | set_beam_stop(data, 0.00669)#, outer=0.025) |
---|
19 | set_top(data, -.018) |
---|
20 | #set_half(data, 'right') |
---|
21 | |
---|
22 | |
---|
23 | if 0: |
---|
24 | model = SasModel(data, OneDGpuCylinder, |
---|
25 | scale=0.0013, radius=105, length=1000, |
---|
26 | background=21, sldCyl=.291e-6,sldSolv=7.105e-6, |
---|
27 | radius_pd=0.1,radius_pd_n=10,radius_pd_nsigma=0, |
---|
28 | length_pd=0.1,length_pd_n=5,length_pd_nsigma=0, |
---|
29 | bolim=0.0, uplim=90) #bottom limit, upper limit of angle integral |
---|
30 | |
---|
31 | |
---|
32 | if 0: |
---|
33 | model = SasModel(data, GpuEllipse, |
---|
34 | scale=0.08, |
---|
35 | radius_a=15, radius_b=800, |
---|
36 | sldEll=.291e-6, sldSolv=7.105e-6, |
---|
37 | background=0, |
---|
38 | axis_theta=90, axis_phi=0, |
---|
39 | axis_theta_pd=15, axis_theta_pd_n=40, axis_theta_pd_nsigma=3, |
---|
40 | radius_a_pd=0.222296, radius_a_pd_n=1, radius_a_pd_nsigma=0, |
---|
41 | radius_b_pd=.000128, radius_b_pd_n=1, radius_b_pd_nsigma=0, |
---|
42 | axis_phi_pd=2.63698e-05, axis_phi_pd_n=20, axis_phi_pd_nsigma=0, |
---|
43 | dtype='float') |
---|
44 | |
---|
45 | |
---|
46 | # SET THE FITTING PARAMETERS |
---|
47 | model.radius_a.range(15, 1000) |
---|
48 | model.radius_b.range(15, 1000) |
---|
49 | #model.axis_theta_pd.range(0, 360) |
---|
50 | #model.background.range(0,1000) |
---|
51 | #model.scale.range(0, 1) |
---|
52 | |
---|
53 | |
---|
54 | if 0: |
---|
55 | model = SasModel(data, GpuLamellar, |
---|
56 | scale=0.08, |
---|
57 | bi_thick=19.2946, |
---|
58 | sld_bi=5.38e-6,sld_sol=7.105e-6, |
---|
59 | background=0.003, |
---|
60 | bi_thick_pd= 0.37765, bi_thick_pd_n=10, bi_thick_pd_nsigma=3, |
---|
61 | dtype='float') |
---|
62 | |
---|
63 | # SET THE FITTING PARAMETERS |
---|
64 | #model.bi_thick.range(0, 1000) |
---|
65 | #model.scale.range(0, 1) |
---|
66 | #model.bi_thick_pd.range(0, 1000) |
---|
67 | #model.background.range(0, 1000) |
---|
68 | model.sld_bi.range(0, 1) |
---|
69 | |
---|
70 | |
---|
71 | if 1: |
---|
72 | model = SasModel(data, GpuCylinder, |
---|
73 | scale=0.0104, radius=92.5, length=798.3, |
---|
74 | sldCyl=.29e-6, sldSolv=7.105e-6, background=5, |
---|
75 | cyl_theta=0, cyl_phi=0, |
---|
76 | cyl_theta_pd=22.11, cyl_theta_pd_n=20, cyl_theta_pd_nsigma=3, |
---|
77 | radius_pd=.0084, radius_pd_n=10, radius_pd_nsigma=3, |
---|
78 | length_pd=0.493, length_pd_n=10, length_pd_nsigma=3, |
---|
79 | cyl_phi_pd=0, cyl_phi_pd_n=1, cyl_phi_pd_nsigma=3, |
---|
80 | dtype='float') |
---|
81 | |
---|
82 | |
---|
83 | |
---|
84 | # SET THE FITTING PARAMETERS |
---|
85 | #model.radius.range(1, 500) |
---|
86 | #model.length.range(1, 4000) |
---|
87 | #model.cyl_theta.range(-90,100) |
---|
88 | #model.cyl_theta_pd.range(0, 90) |
---|
89 | #model.cyl_theta_pd_n = model.cyl_theta_pd + 5 |
---|
90 | #model.radius_pd.range(0, 90) |
---|
91 | #model.length_pd.range(0, 90) |
---|
92 | model.scale.range(0, 1) |
---|
93 | #model.background.range(0, 100) |
---|
94 | #model.sldCyl.range(0, 1) |
---|
95 | |
---|
96 | |
---|
97 | if 0: |
---|
98 | model = SasModel(data, GpuCoreShellCylinder, |
---|
99 | scale= .00031, radius=19.5, thickness=30, length=22, |
---|
100 | core_sld=7.105e-6, shell_sld=.291e-6, solvent_sld=7.105e-6, |
---|
101 | background=0.2, axis_theta=0, axis_phi=0, |
---|
102 | |
---|
103 | radius_pd=0.26, radius_pd_n=10, radius_pd_nsigma=3, |
---|
104 | length_pd=0.26, length_pd_n=10, length_pd_nsigma=3, |
---|
105 | thickness_pd=1, thickness_pd_n=1, thickness_pd_nsigma=1, |
---|
106 | axis_theta_pd=1, axis_theta_pd_n=10, axis_theta_pd_nsigma=3, |
---|
107 | axis_phi_pd=0.1, axis_phi_pd_n=1, axis_phi_pd_nsigma=1, |
---|
108 | dtype='float') |
---|
109 | |
---|
110 | # SET THE FITTING PARAMETERS |
---|
111 | #model.radius.range(115, 1000) |
---|
112 | #model.length.range(0, 2500) |
---|
113 | #model.thickness.range(18, 38) |
---|
114 | #model.thickness_pd.range(0, 1) |
---|
115 | #model.axis_phi.range(0, 90) |
---|
116 | #model.radius_pd.range(0, 1) |
---|
117 | #model.length_pd.range(0, 1) |
---|
118 | #model.axis_theta_pd.range(0, 360) |
---|
119 | #model.background.range(0,5) |
---|
120 | model.scale.range(0, 1) |
---|
121 | |
---|
122 | |
---|
123 | |
---|
124 | if 0: |
---|
125 | model = SasModel(data, GpuCapCylinder, |
---|
126 | scale=1, rad_cyl=20, rad_cap=40, length=400, |
---|
127 | sld_capcyl=1e-6, sld_solv=6.3e-6, |
---|
128 | background=0, theta=0, phi=0, |
---|
129 | rad_cyl_pd=.1, rad_cyl_pd_n=1, rad_cyl_pd_nsigma=0, |
---|
130 | rad_cap_pd=.1, rad_cap_pd_n=1, rad_cap_pd_nsigma=0, |
---|
131 | length_pd=.1, length_pd_n=1, length_pd_nsigma=0, |
---|
132 | theta_pd=.1, theta_pd_n=1, theta_pd_nsigma=0, |
---|
133 | phi_pd=.1, phi_pd_n=1, phi_pd_nsigma=0, |
---|
134 | dtype='float') |
---|
135 | |
---|
136 | model.scale.range(0, 1) |
---|
137 | |
---|
138 | |
---|
139 | if 0: |
---|
140 | model = SasModel(data, GpuTriEllipse, |
---|
141 | scale=0.08, axisA=15, axisB=20, axisC=500, |
---|
142 | sldEll=7.105e-6, sldSolv=.291e-6, |
---|
143 | background=5, theta=0, phi=0, psi=0, |
---|
144 | theta_pd=20, theta_pd_n=40, theta_pd_nsigma=3, |
---|
145 | phi_pd=.1, phi_pd_n=1, phi_pd_nsigma=0, |
---|
146 | psi_pd=30, psi_pd_n=1, psi_pd_nsigma=0, |
---|
147 | axisA_pd=.1, axisA_pd_n=1, axisA_pd_nsigma=0, |
---|
148 | axisB_pd=.1, axisB_pd_n=1, axisB_pd_nsigma=0, |
---|
149 | axisC_pd=.1, axisC_pd_n=1, axisC_pd_nsigma=0, dtype='float') |
---|
150 | |
---|
151 | # SET THE FITTING PARAMETERS |
---|
152 | model.axisA.range(15, 1000) |
---|
153 | model.axisB.range(15, 1000) |
---|
154 | #model.axisC.range(15, 1000) |
---|
155 | #model.background.range(0,1000) |
---|
156 | #model.theta_pd.range(0, 360) |
---|
157 | #model.phi_pd.range(0, 360) |
---|
158 | #model.psi_pd.range(0, 360) |
---|
159 | |
---|
160 | |
---|
161 | |
---|
162 | |
---|
163 | problem = FitProblem(model) |
---|
164 | |
---|