Changeset 3130 for trunk/GSASIIscriptable.py
 Timestamp:
 Oct 12, 2017 10:29:57 AM (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIscriptable.py
r3129 r3130 278 278 Mustrain 279 279 \ type Mustrain model. One of 'isotropic', 280 'uniaxial', or 'generalized' 281 \ direction For uniaxial. A list of three integers, 280 'uniaxial', or 'generalized'. Should always 281 be specified. 282 \ direction For uniaxial only. A list of three 283 integers, 282 284 the [hkl] direction of the axis. 283 \ refine Usually boolean, whether or notto refine.285 \ refine Usually boolean, set to True to refine. 284 286 When in doubt, set it to true. 285 287 For uniaxial model, can specify list 286 of 'axial' or 'equatorial'. If boolean 287 given sets both axial and equatorial. 288 of 'axial' or 'equatorial' or a single 289 boolean sets both axial and equatorial. 290 Size Not implemented 291 \ type Size broadening model. One of 'isotropic', 292 'uniaxial', or 'ellipsoid'. Should always 293 be specified. 294 \ direction For uniaxial only. A list of three 295 integers, 296 the [hkl] direction of the axis. 297 \ refine A boolean, True to refine. 288 298 Pref.Ori. Boolean, True to refine 289 299 Show Boolean, True to refine 290 Size Not implemented291 300 Use Boolean, True to refine 292 301 Scale Phase fraction; Boolean, True to refine … … 2166 2175 mustrain = h['Mustrain'] 2167 2176 newType = None 2177 direction = None 2168 2178 if isinstance(val, (unicode, str)): 2169 2179 if val in ['isotropic', 'uniaxial', 'generalized']: … … 2207 2217 2208 2218 if direction: 2209 direction = [int(n) for n in direction]2210 2219 if len(direction) != 3: 2211 2220 raise ValueError("Expected hkl, found", direction) 2221 direction = [int(n) for n in direction] 2212 2222 mustrain[3] = direction 2223 elif key == 'Size': 2224 for h in histograms: 2225 size = h['Size'] 2226 newType = None 2227 direction = None 2228 if isinstance(val, (unicode, str)): 2229 if val in ['isotropic', 'uniaxial', 'ellipsoidal']: 2230 newType = val 2231 else: 2232 raise ValueError("Not a valid Size type: " + val) 2233 elif isinstance(val, dict): 2234 newType = val.get('type', None) 2235 direction = val.get('direction', None) 2236 2237 if newType: 2238 size[0] = newType 2239 refine = val.get('refine') 2240 if newType == 'isotropic' and refine is not None: 2241 size[2][0] = bool(refine) 2242 elif newType == 'uniaxial' and refine is not None: 2243 size[2][1] = bool(refine) 2244 size[2][2] = bool(refine) 2245 elif newType == 'ellipsoidal' and refine is not None: 2246 size[5] = [bool(refine) for p in size[5]] 2247 2248 if direction: 2249 if len(direction) != 3: 2250 raise ValueError("Expected hkl, found", direction) 2251 direction = [int(n) for n in direction] 2252 size[3] = direction 2213 2253 elif key == 'Pref.Ori.': 2214 2254 for h in histograms: … … 2217 2257 for h in histograms: 2218 2258 h['Show'] = bool(val) 2219 elif key == 'Size':2220 for h in histograms:2221 if h['Size'][0] == 'isotropic':2222 h['Size'][2][0] = bool(val)2223 elif h['Size'][0] == 'uniaxial':2224 h['Size'][2][1] = bool(val)2225 h['Size'][2][2] = bool(val)2226 else: # TODO2227 raise NotImplementedError()2228 2259 elif key == 'Use': 2229 2260 for h in histograms: … … 2272 2303 for h in histograms: 2273 2304 mustrain = h['Mustrain'] 2274 mustrain[2] = [False for p in mustrain[ 1]]2305 mustrain[2] = [False for p in mustrain[2]] 2275 2306 mustrain[5] = [False for p in mustrain[4]] 2276 2307 elif key == 'Pref.Ori.': … … 2281 2312 h['Show'] = False 2282 2313 elif key == 'Size': 2283 raise NotImplementedError() 2314 for h in histograms: 2315 size = h['Size'] 2316 size[2] = [False for p in size[2]] 2317 size[5] = [False for p in size[5]] 2284 2318 elif key == 'Use': 2285 2319 for h in histograms:
Note: See TracChangeset
for help on using the changeset viewer.