Changeset f1765a2 in sasmodels for sasmodels/convert.py
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.