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