Changeset f8f5a37 in sasmodels
- Timestamp:
- Nov 17, 2016 11:51:53 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
- Parents:
- 47fafe9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/convert.py
r47fafe9 rf8f5a37 49 49 # Convert new style names for polydispersity info to old style names 50 50 PD_DOT = [ 51 ("", ""),52 51 ("_pd", ".width"), 53 52 ("_pd_n", ".npts"), … … 55 54 ("_pd_type", ".type"), 56 55 ] 57 58 CONVERT_OLD =[59 "fittable",60 "std",61 "upper",62 "lower",63 "units"64 ]65 56 66 57 def _rescale(par, scale): … … 220 211 # now uses radius and thickness 221 212 thickness = oldpars['radius'] - oldpars['core_radius'] 222 pd = oldpars['radius.width']*oldpars['radius']/thickness223 213 oldpars['radius'] = thickness 224 oldpars['radius.width'] = pd 214 if 'radius.width' in oldpars: 215 pd = oldpars['radius.width']*oldpars['radius']/thickness 216 oldpars['radius.width'] = pd 225 217 elif name == 'pearl_necklace': 226 218 pass … … 267 259 p_c1 = oldpars['c1'] 268 260 p_c2= oldpars['c2'] 269 xi = math.sqrt(2/(math.sqrt(p_scale/p_c2) + 0.5*p_c1/p_c2)) 261 i_1 = 0.5*p_c1/p_c2 262 i_2 = math.sqrt(math.fabs(p_scale/p_c2)) 263 i_3 = 2/(i_1 + i_2) 264 xi = math.sqrt(math.fabs(i_3)) 270 265 271 266 # find d from xi 272 k = math.sqrt( 1 - 0.5*p_c1/p_c2*xi**2)267 k = math.sqrt(math.fabs(1 - 0.5*p_c1/p_c2*xi**2)) 273 268 d = 2*math.pi*xi/k 274 269 … … 302 297 model_info = load_model_info(newname) 303 298 translation = _get_translation_table(model_info) 304 newpars = _ convert_name(translation, pars.copy())305 newpars = _ hand_convert(newname, newpars)299 newpars = _hand_convert(newname, pars.copy()) 300 newpars = _convert_name(translation, newpars) 306 301 newpars = _convert_pars(newpars, translation) 307 302 if not model_info.structure_factor:
Note: See TracChangeset
for help on using the changeset viewer.