Changeset 16fd9e5 in sasmodels
- Timestamp:
- Dec 9, 2016 1:48:21 PM (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:
- 01ecc31
- Parents:
- 298621b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/convert.py
r298621b r16fd9e5 92 92 93 93 94 def _get_translation_table(model_info, version=' 4.0.1'):94 def _get_translation_table(model_info, version='3.1.2'): 95 95 _, translation = CONVERSION_TABLE.get(version).get(model_info.id, [None, {}]) 96 96 translation = translation.copy() … … 145 145 return newpars 146 146 147 def _conversion_target(model_name, version=' 4.0.1'):147 def _conversion_target(model_name, version='3.1.2'): 148 148 """ 149 149 Find the sasmodel name which translates into the sasview name. … … 218 218 if 'ndensity.upper' in oldpars: 219 219 oldpars['ndensity.upper'] /= 1e15 220 elif name == 'rpa' and version == '4.0.1':220 elif name == 'rpa' and version == base_version: 221 221 # convert scattering lengths from femtometers to centimeters 222 222 for p in "L1", "L2", "L3", "L4": … … 228 228 oldpars[p + ".upper"] /= 1e-13 229 229 elif name == 'spherical_sld' and version == base_version: 230 oldpars["CONTROL"] = 0 231 i = 0 232 while "nu_inter" + str(i) in oldpars: 233 oldpars["CONTROL"] += 1 234 i += 1 230 j = 0 231 while "func_inter" + str(j) in oldpars: 232 name = "func_inter" + str(j) 233 new_name = "shape" + str(j + 1) 234 if oldpars[name] == 'Erf(|nu|*z)': 235 oldpars[new_name] = int(0) 236 elif oldpars[name] == 'RPower(z^|nu|)': 237 oldpars[new_name] = int(1) 238 elif oldpars[name] == 'LPower(z^|nu|)': 239 oldpars[new_name] = int(2) 240 elif oldpars[name] == 'RExp(-|nu|*z)': 241 oldpars[new_name] = int(3) 242 elif oldpars[name] == 'LExp(-|nu|*z)': 243 oldpars[new_name] = int(4) 244 else: 245 oldpars[new_name] = int(0) 246 oldpars.pop(name) 247 oldpars['n_shells'] = str(j + 1) 248 j += 1 235 249 elif name == 'teubner_strey' and version == base_version: 236 250 # basically undoing the entire Teubner-Strey calculations here.
Note: See TracChangeset
for help on using the changeset viewer.