Changeset 54fb5d8 in sasmodels
- Timestamp:
- Dec 19, 2016 9:59:01 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:
- 86e8e66
- Parents:
- 01ecc31
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/convert.py
r16fd9e5 r54fb5d8 160 160 161 161 def _hand_convert(name, oldpars, version='3.1.2'): 162 base_version = '3.1.2' 163 if name == 'core_shell_parallelepiped' and version == base_version: 162 if version == '3.1.2': 163 oldpars = _hand_convert_3_1_2_to_4_1(name, oldpars) 164 return oldpars 165 166 def _hand_convert_3_1_2_to_4_1(name, oldpars): 167 if name == 'core_shell_parallelepiped': 164 168 # Make sure pd on rim parameters defaults to zero 165 169 # ... probably not necessary. … … 167 171 oldpars['rimB.width'] = 0.0 168 172 oldpars['rimC.width'] = 0.0 169 elif name == 'core_shell_ellipsoid:1' and version == base_version:173 elif name == 'core_shell_ellipsoid:1': 170 174 # Reverse translation (from new to old), from core_shell_ellipsoid.c 171 175 # equat_shell = equat_core + thick_shell … … 186 190 oldpars['polar_core'] = polar_core / equat_core 187 191 oldpars['polar_shell'] = (polar_shell-polar_core)/(equat_shell-equat_core) 188 elif name == 'hollow_cylinder' and version == base_version:192 elif name == 'hollow_cylinder': 189 193 # now uses radius and thickness 190 194 thickness = oldpars['radius'] - oldpars['core_radius'] … … 193 197 pd = oldpars['radius.width']*oldpars['radius']/thickness 194 198 oldpars['radius.width'] = pd 195 elif name == 'multilayer_vesicle' and version == base_version:199 elif name == 'multilayer_vesicle': 196 200 if 'scale' in oldpars: 197 201 oldpars['volfraction'] = oldpars['scale'] … … 207 211 if 'scale.units' in oldpars: 208 212 oldpars['volfraction.units'] = oldpars['scale.units'] 209 elif name == 'pearl_necklace' and version == base_version:213 elif name == 'pearl_necklace': 210 214 pass 211 215 #_remove_pd(oldpars, 'num_pearls', name) 212 216 #_remove_pd(oldpars, 'thick_string', name) 213 elif name == 'polymer_micelle' and version == base_version:217 elif name == 'polymer_micelle': 214 218 if 'ndensity' in oldpars: 215 219 oldpars['ndensity'] /= 1e15 … … 218 222 if 'ndensity.upper' in oldpars: 219 223 oldpars['ndensity.upper'] /= 1e15 220 elif name == 'rpa' and version == base_version:224 elif name == 'rpa': 221 225 # convert scattering lengths from femtometers to centimeters 222 226 for p in "L1", "L2", "L3", "L4": … … 227 231 if p + ".upper" in oldpars: 228 232 oldpars[p + ".upper"] /= 1e-13 229 elif name == 'spherical_sld' and version == base_version:233 elif name == 'spherical_sld': 230 234 j = 0 231 235 while "func_inter" + str(j) in oldpars: … … 247 251 oldpars['n_shells'] = str(j + 1) 248 252 j += 1 249 elif name == 'teubner_strey' and version == base_version:253 elif name == 'teubner_strey': 250 254 # basically undoing the entire Teubner-Strey calculations here. 251 255 # drho = (sld_a - sld_b)
Note: See TracChangeset
for help on using the changeset viewer.