Changes in / [e6ab0d3:16a8c63] in sasmodels
- Location:
- sasmodels/models
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/barbell.py
rfcb33e4 r0b56f38 87 87 * **Last Reviewed by:** Richard Heenan **Date:** January 4, 2017 88 88 """ 89 from numpy import inf 89 from numpy import inf, sin, cos, pi 90 90 91 91 name = "barbell" … … 125 125 phi_pd=15, phi_pd_n=0, 126 126 ) 127 q = 0.1 128 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 129 qx = q*cos(pi/6.0) 130 qy = q*sin(pi/6.0) 131 tests = [[{}, 0.075, 25.5691260532], 132 [{'theta':80., 'phi':10.}, (qx, qy), 3.04233067789], 133 ] 134 del qx, qy # not necessary to delete, but cleaner -
sasmodels/models/bcc_paracrystal.py
r925ad6e re2d6e3b 99 99 """ 100 100 101 from numpy import inf 101 from numpy import inf, pi 102 102 103 103 name = "bcc_paracrystal" … … 141 141 psi_pd=15, psi_pd_n=0, 142 142 ) 143 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 144 # add 2d test later 145 q =4.*pi/220. 146 tests = [ 147 [{ }, 148 [0.001, q, 0.215268], [1.46601394721, 2.85851284174, 0.00866710287078]], 149 ] -
sasmodels/models/capped_cylinder.py
rfcb33e4 r0b56f38 91 91 92 92 """ 93 from numpy import inf 93 from numpy import inf, sin, cos, pi 94 94 95 95 name = "capped_cylinder" … … 145 145 theta_pd=15, theta_pd_n=45, 146 146 phi_pd=15, phi_pd_n=1) 147 q = 0.1 148 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 149 qx = q*cos(pi/6.0) 150 qy = q*sin(pi/6.0) 151 tests = [[{}, 0.075, 26.0698570695], 152 [{'theta':80., 'phi':10.}, (qx, qy), 0.561811990502], 153 ] 154 del qx, qy # not necessary to delete, but cleaner -
sasmodels/models/core_shell_bicelle.py
r8afefae r0b56f38 88 88 """ 89 89 90 from numpy import inf, sin, cos 90 from numpy import inf, sin, cos, pi 91 91 92 92 name = "core_shell_bicelle" … … 155 155 theta=90, 156 156 phi=0) 157 q = 0.1 158 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 159 qx = q*cos(pi/6.0) 160 qy = q*sin(pi/6.0) 161 tests = [[{}, 0.05, 7.4883545957], 162 [{'theta':80., 'phi':10.}, (qx, qy), 2.81048892474 ], 163 ] 164 del qx, qy # not necessary to delete, but cleaner 157 165 158 #qx, qy = 0.4 * cos(pi/2.0), 0.5 * sin(0) -
sasmodels/models/core_shell_bicelle_elliptical.py
r15a90c1 r15a90c1 99 99 """ 100 100 101 from numpy import inf, sin, cos 101 from numpy import inf, sin, cos, pi 102 102 103 103 name = "core_shell_bicelle_elliptical" … … 150 150 psi=0) 151 151 152 #qx, qy = 0.4 * cos(pi/2.0), 0.5 * sin(0) 152 q = 0.1 153 # april 6 2017, rkh added a 2d unit test, NOT READY YET pull #890 branch assume correct! 154 qx = q*cos(pi/6.0) 155 qy = q*sin(pi/6.0) 153 156 154 157 tests = [ … … 159 162 'sld_core':4.0, 'sld_face':7.0, 'sld_rim':1.0, 'sld_solvent':6.0, 'background':0.0}, 160 163 0.015, 286.540286], 161 ] 164 # [{'theta':80., 'phi':10.}, (qx, qy), 7.88866563001 ], 165 ] 166 167 del qx, qy # not necessary to delete, but cleaner -
sasmodels/models/core_shell_cylinder.py
r8e68ea0 r0b56f38 73 73 """ 74 74 75 from numpy import pi, inf 75 from numpy import pi, inf, sin, cos 76 76 77 77 name = "core_shell_cylinder" … … 151 151 theta_pd=15, theta_pd_n=45, 152 152 phi_pd=15, phi_pd_n=1) 153 153 q = 0.1 154 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 155 qx = q*cos(pi/6.0) 156 qy = q*sin(pi/6.0) 157 tests = [[{}, 0.075, 10.8552692237], 158 [{}, (qx, qy), 0.444618752741 ], 159 ] 160 del qx, qy # not necessary to delete, but cleaner -
sasmodels/models/ellipsoid.py
r4b0a294 r0b56f38 120 120 """ 121 121 122 from numpy import inf 122 from numpy import inf, sin, cos, pi 123 123 124 124 name = "ellipsoid" … … 190 190 theta_pd=15, theta_pd_n=45, 191 191 phi_pd=15, phi_pd_n=1) 192 q = 0.1 193 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 194 qx = q*cos(pi/6.0) 195 qy = q*sin(pi/6.0) 196 tests = [[{}, 0.05, 54.8525847025], 197 [{'theta':80., 'phi':10.}, (qx, qy), 1.74134670026 ], 198 ] 199 del qx, qy # not necessary to delete, but cleaner -
sasmodels/models/elliptical_cylinder.py
r15a90c1 r15a90c1 109 109 """ 110 110 111 from numpy import pi, inf, sqrt 111 from numpy import pi, inf, sqrt, sin, cos 112 112 113 113 name = "elliptical_cylinder" … … 150 150 + (length + radius) * (length + pi * radius)) 151 151 return 0.5 * (ddd) ** (1. / 3.) 152 q = 0.1 153 # april 6 2017, rkh added a 2d unit test, NOT READY YET pull #890 branch assume correct! 154 qx = q*cos(pi/6.0) 155 qy = q*sin(pi/6.0) 152 156 153 157 tests = [ … … 159 163 'sld_solvent':1.0, 'background':0.0}, 160 164 0.001, 675.504402], 165 # [{'theta':80., 'phi':10.}, (qx, qy), 7.88866563001 ], 161 166 ] -
sasmodels/models/fcc_paracrystal.py
r925ad6e re2d6e3b 90 90 """ 91 91 92 from numpy import inf 92 from numpy import inf, pi 93 93 94 94 name = "fcc_paracrystal" … … 128 128 psi_pd=15, psi_pd_n=0, 129 129 ) 130 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 131 # add 2d test later 132 q =4.*pi/220. 133 tests = [ 134 [{ }, 135 [0.001, q, 0.215268], [0.275164706668, 5.7776842567, 0.00958167119232]], 136 ] -
sasmodels/models/hollow_cylinder.py
raea2e2a r0b56f38 60 60 """ 61 61 62 from numpy import pi, inf 62 from numpy import pi, inf, sin, cos 63 63 64 64 name = "hollow_cylinder" … … 129 129 theta_pd=10, theta_pd_n=5, 130 130 ) 131 131 q = 0.1 132 # april 6 2017, rkh added a 2d unit test, assume correct! 133 qx = q*cos(pi/6.0) 134 qy = q*sin(pi/6.0) 132 135 # Parameters for unit tests 133 136 tests = [ 134 137 [{}, 0.00005, 1764.926], 135 138 [{}, 'VR', 1.8], 136 [{}, 0.001, 1756.76] 137 ] 139 [{}, 0.001, 1756.76], 140 [{}, (qx, qy), 2.36885476192 ], 141 ] 142 del qx, qy # not necessary to delete, but cleaner -
sasmodels/models/stacked_disks.py
rb7e8b94 r0b56f38 103 103 """ 104 104 105 from numpy import inf 105 from numpy import inf, sin, cos, pi 106 106 107 107 name = "stacked_disks" … … 152 152 # After redefinition of spherical coordinates - 153 153 # tests had in old coords theta=0, phi=0; new coords theta=90, phi=0 154 # but should not matter here as so far all the tests are 1D not 2D 154 q = 0.1 155 # april 6 2017, rkh added a 2d unit test, assume correct! 156 qx = q*cos(pi/6.0) 157 qy = q*sin(pi/6.0) 155 158 tests = [ 156 159 # Accuracy tests based on content in test/utest_extra_models.py. … … 186 189 [{'thick_core': 10.0, 187 190 'thick_layer': 15.0, 191 'radius': 100.0, 192 'n_stacking': 5, 193 'sigma_d': 0.0, 194 'sld_core': 4.0, 195 'sld_layer': -0.4, 196 'solvent_sd': 5.0, 197 'theta': 90.0, 198 'phi': 20.0, 199 'scale': 0.01, 200 'background': 0.001}, 201 (qx, qy), 0.0491167089952 ], 202 [{'thick_core': 10.0, 203 'thick_layer': 15.0, 188 204 'radius': 3000.0, 189 205 'n_stacking': 5, … … 228 244 'background': 0.001, 229 245 }, ([0.4, 0.5]), [0.00105074, 0.00121761]], 246 [{'thick_core': 10.0, 247 'thick_layer': 15.0, 248 'radius': 3000.0, 249 'n_stacking': 1.0, 250 'sigma_d': 0.0, 251 'sld_core': 4.0, 252 'sld_layer': -0.4, 253 'solvent_sd': 5.0, 254 'theta': 90.0, 255 'phi': 20.0, 256 'scale': 0.01, 257 'background': 0.001, 258 }, (qx, qy), 0.0341738733124 ], 230 259 231 260 [{'thick_core': 10.0, -
sasmodels/models/triaxial_ellipsoid.py
r15a90c1 r15a90c1 86 86 The contrast $\Delta\rho$ is defined as SLD(ellipsoid) - SLD(solvent). In the 87 87 parameters, $R_a$ is the minor equatorial radius, $R_b$ is the major 88 equatorial radius, and $R_c$ is the polar radius of the ellipsoid. 88 equatorial radius, and $R_c$ is the polar radius of the ellipsoid. 89 89 90 90 NB: The 2nd virial coefficient of the triaxial solid ellipsoid is … … 117 117 """ 118 118 119 from numpy import inf 119 from numpy import inf, sin, cos, pi 120 120 121 121 name = "triaxial_ellipsoid" … … 157 157 from .ellipsoid import ER as ellipsoid_ER 158 158 159 # now that radii can be in any size order, radii need sorting a,b,c where a~b and c is either much smaller 159 # now that radii can be in any size order, radii need sorting a,b,c where a~b and c is either much smaller 160 160 # or much larger 161 161 radii = np.vstack((radius_equat_major, radius_equat_minor, radius_polar)) … … 177 177 psi_pd=15, psi_pd_n=1) 178 178 179 # TODO: need some unit tests! 179 q = 0.1 180 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 181 # add 2d test after pull #890 182 qx = q*cos(pi/6.0) 183 qy = q*sin(pi/6.0) 184 tests = [[{}, 0.05, 24.8839548033], 185 # [{'theta':80., 'phi':10.}, (qx, qy), 9999. ], 186 ] 187 del qx, qy # not necessary to delete, but cleaner
Note: See TracChangeset
for help on using the changeset viewer.