Changeset f1765a2 in sasmodels
- Timestamp:
- Jul 24, 2016 2:20:08 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 2c74c11
- Parents:
- 7b7da6b
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/conversion_table.py
r32e3c9b rf1765a2 86 86 "sld_core": "sld_core0", 87 87 "sld_solvent": "sld_solv", 88 "n": "n_shells" 88 "n": "n_shells", 89 "M0:sld_core": "M0_sld_core0", 90 "mtheta:sld_core": "M_theta_core0", 91 "mphi:sld_core": "M_phi_core0", 92 "M0:sld1": "M0_sld_shell1", 93 "mtheta:sld1": "M_theta_shell1", 94 "mphi:sld1": "M_phi_shell1", 95 "M0:sld2": "M0_sld_shell2", 96 "mtheta:sld2": "M_theta_shell2", 97 "mphi:sld2": "M_phi_shell2", 98 "M0:sld3": "M0_sld_shell3", 99 "mtheta:sld3": "M_theta_shell3", 100 "mphi:sld3": "M_phi_shell3", 101 "M0:sld4": "M0_sld_shell4", 102 "mtheta:sld4": "M_theta_shell4", 103 "mphi:sld4": "M_phi_shell4", 104 "M0:sld_solvent": "M0_sld_solv", 105 "mtheta:sld_solvent": "M_theta_solv", 106 "mphi:sld_solvent": "M_phi_solv", 107 "up:frac_i": "Up_frac_i", 108 "up:frac_f": "Up_frac_f", 109 "up:angle": "Up_theta", 89 110 } 90 111 ], … … 161 182 "CoreShellModel", 162 183 { 184 "sld_core": "core_sld", 163 185 "sld_shell": "shell_sld", 164 186 "sld_solvent": "solvent_sld", 165 "sld_core": "core_sld" 187 "M0:sld_core": "M0_sld_core", 188 "mtheta:sld_core": "M_theta_core", 189 "mphi:sld_core": "M_phi_core", 190 "M0:sld_shell": "M0_sld_shell", 191 "mtheta:sld_shell": "M_theta_shell", 192 "mphi:sld_shell": "M_phi_shell", 193 "M0:sld_solvent": "M0_sld_solv", 194 "mtheta:sld_solvent": "M_theta_solv", 195 "mphi:sld_solvent": "M_phi_solv", 196 "up:frac_i": "Up_frac_i", 197 "up:frac_f": "Up_frac_f", 198 "up:angle": "Up_theta" 166 199 } 167 200 ], … … 506 539 "sld": "sldPipe", 507 540 "theta": "parallel_theta", 508 "c_side": "long_c" 541 "c_side": "long_c", 542 "M0:sld": "M0_sld_pipe", 543 "mtheta:sld": "M_theta_pipe", 544 "mphi:sld": "M_phi_pipe", 545 "M0:sld_solvent": "M0_sld_solv", 546 "mtheta:sld_solvent": "M_theta_solv", 547 "mphi:sld_solvent": "M_phi_solv", 548 "up:frac_i": "Up_frac_i", 549 "up:frac_f": "Up_frac_f", 550 "up:angle": "Up_theta", 509 551 } 510 552 ], -
sasmodels/convert.py
r32e3c9b rf1765a2 38 38 ] 39 39 40 MAGNETIC_SASVIEW_MODELS = [ 41 'core_shell', 42 'core_multi_shell', 43 'cylinder', 44 'parallelepiped', 45 'sphere', 46 ] 47 40 48 41 49 # Convert new style names for polydispersity info to old style names … … 193 201 warnings.warn("parameter background not used in sasview %s"%name) 194 202 203 # Remove magnetic parameters from non-magnetic sasview models 204 if name not in MAGNETIC_SASVIEW_MODELS: 205 oldpars = dict((k,v) for k,v in oldpars.items() if ':' not in k) 195 206 196 207 # If it is a product model P*S, then check the individual forms for special … … 218 229 _remove_pd(oldpars, 'thick_flat'+str(k), 'thick_flat') 219 230 _remove_pd(oldpars, 'thick_inter'+str(k), 'thick_inter') 231 elif name == 'core_multi_shell': 232 # kill extra shells 233 for k in range(5, 11): 234 oldpars.pop('sld_shell'+str(k), 0) 235 oldpars.pop('thick_shell'+str(k), 0) 236 oldpars.pop('mtheta:sld'+str(k), 0) 237 oldpars.pop('mphi:sld'+str(k), 0) 238 oldpars.pop('M0:sld'+str(k), 0) 239 _remove_pd(oldpars, 'sld_shell'+str(k), 'sld') 240 _remove_pd(oldpars, 'thick_shell'+str(k), 'thickness') 241 elif name == 'core_shell_parallelepiped': 242 _remove_pd(oldpars, 'rimA', name) 243 elif name in ['mono_gauss_coil','poly_gauss_coil']: 244 del oldpars['i_zero'] 245 elif name == 'onion': 246 oldpars.pop('n_shells', None) 220 247 elif name == 'rpa': 221 248 # convert scattering lengths from femtometers to centimeters … … 234 261 for k in "Kab,Kac,Kad".split(','): 235 262 oldpars.pop(k, None) 236 elif name == 'core_shell_parallelepiped':237 _remove_pd(oldpars, 'rimA', name)238 elif name in ['mono_gauss_coil','poly_gauss_coil']:239 del oldpars['i_zero']240 elif name == 'onion':241 oldpars.pop('n_shells', None)242 263 243 264 return oldpars … … 256 277 if '*' in name: 257 278 pars['background'] = 0 279 280 # Shut off magnetism when comparing non-magnetic sasview models 281 if name not in MAGNETIC_SASVIEW_MODELS: 282 suppress_magnetism = False 283 for key in pars.keys(): 284 suppress_magnetism = suppress_magnetism or (pars[key] != 0) 285 if key.startswith("M0:"): 286 pars[key] = 0 287 if suppress_magnetism: 288 warnings.warn("suppressing magnetism for comparison with sasview") 289 290 # Shut off theta polydispersity since algorithm has changed 291 if 'theta_pd_n' in pars: 292 if pars['theta_pd_n'] != 0: 293 warnings.warn("suppressing theta polydispersity for comparison with sasview") 294 pars['theta_pd_n'] = 0 258 295 259 296 # If it is a product model P*S, then check the individual forms for special
Note: See TracChangeset
for help on using the changeset viewer.