Changeset b7e8b94 in sasmodels
- Timestamp:
- Jan 11, 2017 7:20:03 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 3a45c2c, 8afefae, 7c2935c
- Parents:
- fcb33e4
- Location:
- sasmodels
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernel_header.c
rf1ec7002 rb7e8b94 149 149 150 150 #if 1 151 //think cos(theta) should be sin(theta) in new coords, RKH 11Jan2017 151 152 #define ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sn, cn) do { \ 152 153 SINCOS(phi*M_PI_180, sn, cn); \ 153 154 q = sqrt(qx*qx + qy*qy); \ 154 cn = (q==0. ? 1.0 : (cn*qx + sn*qy)/q * cos(theta*M_PI_180)); \155 cn = (q==0. ? 1.0 : (cn*qx + sn*qy)/q * sin(theta*M_PI_180)); \ 155 156 sn = sqrt(1 - cn*cn); \ 156 157 } while (0) -
sasmodels/models/core_shell_ellipsoid.py
rfcb33e4 rb7e8b94 162 162 163 163 q = 0.1 164 phi = pi/6 165 qx = q*cos(phi) 166 qy = q*sin(phi) 167 # After redefinition of angles find new reasonable values for unit test 164 # tests had in old coords theta=0, phi=0; new coords theta=90, phi=0 165 qx = q*cos(pi/6.0) 166 qy = q*sin(pi/6.0) 167 phi = 0.0 168 # 11Jan2017 RKH sorted tests after redefinition of angles 168 169 tests = [ 169 170 # Accuracy tests based on content in test/utest_coreshellellipsoidXTmodel.py … … 192 193 'scale': 1.0, 193 194 }, 0.01, 8688.53], 194 195 [{'background': 0.001}, (0.4, 0.5), 0.00690673],195 # why does it need theta setting here, not globally above? 196 [{'background': 0.001, 'theta':90.0}, (0.4, 0.5), 0.00690673], 196 197 197 198 [{'radius_equat_core': 20.0, … … 204 205 'background': 0.01, 205 206 'scale': 0.01, 206 # assuming theta and phi zero here? 207 'theta': 90.0, 207 208 }, (qx, qy), 0.01000025], 208 209 ] -
sasmodels/models/cylinder.py
rfcb33e4 rb7e8b94 152 152 tests = [[{}, 0.2, 0.042761386790780453], 153 153 [{}, [0.2], [0.042761386790780453]], 154 # expect new [{'theta':80.1534480601659, 'phi':10.1510817110481}, (qx, qy), 0.03514647218513852], 155 # [{'theta':80.1534480601659, 'phi':10.1510817110481}, [(qx, qy)], [0.03514647218513852]], 156 # old, but calcs .0344268 [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 157 # [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 154 # new coords 155 [{'theta':80.1534480601659, 'phi':10.1510817110481}, (qx, qy), 0.03514647218513852], 156 [{'theta':80.1534480601659, 'phi':10.1510817110481}, [(qx, qy)], [0.03514647218513852]], 157 # old coords [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 158 # [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 158 159 ] 159 160 del qx, qy # not necessary to delete, but cleaner -
sasmodels/models/stacked_disks.py
r07300ea rb7e8b94 148 148 sld_layer=0.0, 149 149 sld_solvent=5.0, 150 theta= 0,150 theta=90, 151 151 phi=0) 152 #After redefinition to spherical coordinates find new reasonable test values 153 #tests = [ 154 # # Accuracy tests based on content in test/utest_extra_models.py. 155 # # Added 2 tests with n_stacked = 5 using SasView 3.1.2 - PDB 156 # [{'thick_core': 10.0, 157 # 'thick_layer': 15.0, 158 # 'radius': 3000.0, 159 # 'n_stacking': 1.0, 160 # 'sigma_d': 0.0, 161 # 'sld_core': 4.0, 162 # 'sld_layer': -0.4, 163 # 'solvent_sd': 5.0, 164 # 'theta': 0.0, 165 # 'phi': 0.0, 166 # 'scale': 0.01, 167 # 'background': 0.001, 168 # }, 0.001, 5075.12], 169 170 # [{'thick_core': 10.0, 171 # 'thick_layer': 15.0, 172 # 'radius': 3000.0, 173 # 'n_stacking': 5.0, 174 # 'sigma_d': 0.0, 175 # 'sld_core': 4.0, 176 # 'sld_layer': -0.4, 177 # 'solvent_sd': 5.0, 178 # 'theta': 0.0, 179 # 'phi': 0.0, 180 # 'scale': 0.01, 181 # 'background': 0.001, 182 # }, 0.001, 5065.12793824], 183 184 # [{'thick_core': 10.0, 185 # 'thick_layer': 15.0, 186 # 'radius': 3000.0, 187 # 'n_stacking': 5.0, 188 # 'sigma_d': 0.0, 189 # 'sld_core': 4.0, 190 # 'sld_layer': -0.4, 191 # 'solvent_sd': 5.0, 192 # 'theta': 0.0, 193 # 'phi': 0.0, 194 # 'scale': 0.01, 195 # 'background': 0.001, 196 # }, 0.164, 0.0127673597265], 197 198 # [{'thick_core': 10.0, 199 # 'thick_layer': 15.0, 200 # 'radius': 3000.0, 201 # 'n_stacking': 1.0, 202 # 'sigma_d': 0.0, 203 # 'sld_core': 4.0, 204 # 'sld_layer': -0.4, 205 # 'solvent_sd': 5.0, 206 # 'theta': 0.0, 207 # 'phi': 0.0, 208 # 'scale': 0.01, 209 # 'background': 0.001, 210 # }, [0.001, 90.0], [5075.12, 0.001]], 211 212 # [{'thick_core': 10.0, 213 # 'thick_layer': 15.0, 214 # 'radius': 3000.0, 215 # 'n_stacking': 1.0, 216 # 'sigma_d': 0.0, 217 # 'sld_core': 4.0, 218 # 'sld_layer': -0.4, 219 # 'solvent_sd': 5.0, 220 # 'theta': 0.0, 221 # 'phi': 0.0, 222 # 'scale': 0.01, 223 # 'background': 0.001, 224 # }, ([0.4, 0.5]), [0.00105074, 0.00121761]], 225 226 # [{'thick_core': 10.0, 227 # 'thick_layer': 15.0, 228 # 'radius': 3000.0, 229 # 'n_stacking': 1.0, 230 # 'sigma_d': 0.0, 231 # 'sld_core': 4.0, 232 # 'sld_layer': -0.4, 233 # 'solvent_sd': 5.0, 234 # 'theta': 0.0, 235 # 'phi': 0.0, 236 # 'scale': 0.01, 237 # 'background': 0.001, 238 # }, ([1.3, 1.57]), [0.0010039, 0.0010038]], 239 # ] 240 # 21Mar2016 RKH notes that unit tests all have n_stacking=1, ought to test other values 241 152 # After redefinition of spherical coordinates - 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 155 tests = [ 156 # Accuracy tests based on content in test/utest_extra_models.py. 157 # Added 2 tests with n_stacked = 5 using SasView 3.1.2 - PDB; for which alas q=0.001 values seem closer to n_stacked=1 not 5, changed assuming my 4.1 code OK, RKH 158 [{'thick_core': 10.0, 159 'thick_layer': 15.0, 160 'radius': 3000.0, 161 'n_stacking': 1.0, 162 'sigma_d': 0.0, 163 'sld_core': 4.0, 164 'sld_layer': -0.4, 165 'solvent_sd': 5.0, 166 'theta': 90.0, 167 'phi': 0.0, 168 'scale': 0.01, 169 'background': 0.001, 170 }, 0.001, 5075.12], 171 [{'thick_core': 10.0, 172 'thick_layer': 15.0, 173 'radius': 3000.0, 174 'n_stacking': 5, 175 'sigma_d': 0.0, 176 'sld_core': 4.0, 177 'sld_layer': -0.4, 178 'solvent_sd': 5.0, 179 'theta': 90.0, 180 'phi': 0.0, 181 'scale': 0.01, 182 'background': 0.001, 183 # }, 0.001, 5065.12793824], n_stacking=1 not 5 ? slight change in value here 11jan2017, check other cpu types 184 # }, 0.001, 5075.11570493], 185 }, 0.001, 25325.635693], 186 [{'thick_core': 10.0, 187 'thick_layer': 15.0, 188 'radius': 3000.0, 189 'n_stacking': 5, 190 'sigma_d': 0.0, 191 'sld_core': 4.0, 192 'sld_layer': -0.4, 193 'solvent_sd': 5.0, 194 'theta': 90.0, 195 'phi': 0.0, 196 'scale': 0.01, 197 'background': 0.001, 198 # }, 0.164, 0.0127673597265], n_stacking=1 not 5 ? slight change in value here 11jan2017, check other cpu types 199 # }, 0.164, 0.01480812968], 200 }, 0.164, 0.0598367986509], 201 202 [{'thick_core': 10.0, 203 'thick_layer': 15.0, 204 'radius': 3000.0, 205 'n_stacking': 1.0, 206 'sigma_d': 0.0, 207 'sld_core': 4.0, 208 'sld_layer': -0.4, 209 'solvent_sd': 5.0, 210 'theta': 90.0, 211 'phi': 0.0, 212 'scale': 0.01, 213 'background': 0.001, 214 # second test here was at q=90, changed it to q=5, note I(q) is then just value of flat background 215 }, [0.001, 5.0], [5075.12, 0.001]], 216 217 [{'thick_core': 10.0, 218 'thick_layer': 15.0, 219 'radius': 3000.0, 220 'n_stacking': 1.0, 221 'sigma_d': 0.0, 222 'sld_core': 4.0, 223 'sld_layer': -0.4, 224 'solvent_sd': 5.0, 225 'theta': 90.0, 226 'phi': 0.0, 227 'scale': 0.01, 228 'background': 0.001, 229 }, ([0.4, 0.5]), [0.00105074, 0.00121761]], 230 231 [{'thick_core': 10.0, 232 'thick_layer': 15.0, 233 'radius': 3000.0, 234 'n_stacking': 1.0, 235 'sigma_d': 0.0, 236 'sld_core': 4.0, 237 'sld_layer': -0.4, 238 'solvent_sd': 5.0, 239 'theta': 90.0, 240 'phi': 0.0, 241 'scale': 0.01, 242 'background': 0.001, 243 }, ([1.3, 1.57]), [0.0010039, 0.0010038]], 244 ] 245 # 11Jan2017 RKH checking unit test agai, note they are all 1D, no 2D 246
Note: See TracChangeset
for help on using the changeset viewer.