Changeset 441
- Timestamp:
- Dec 11, 2011 3:09:49 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r440 r441 1509 1509 dlg.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5)) 1510 1510 dlg.SetSize(Size) 1511 try: 1512 G2str.Refine(self.GSASprojectfile,dlg) 1511 Rwp = 100.00 1512 try: 1513 Rwp = G2str.Refine(self.GSASprojectfile,dlg) 1513 1514 finally: 1514 1515 dlg.Destroy() 1515 dlg = wx.MessageDialog(self,'Load new result?','Refinement results ',wx.OK|wx.CANCEL)1516 dlg = wx.MessageDialog(self,'Load new result?','Refinement results, Rwp =%.3f'%(Rwp),wx.OK|wx.CANCEL) 1516 1517 try: 1517 1518 if dlg.ShowModal() == wx.ID_OK: -
trunk/GSASIIstruct.py
r440 r441 1068 1068 controlDict[pfx+item+'Type'] = hapData[item][0] 1069 1069 if hapData[item][0] in ['isotropic','uniaxial']: 1070 hapDict[pfx+item+': 0'] = hapData[item][1][0]1070 hapDict[pfx+item+':i'] = hapData[item][1][0] 1071 1071 if hapData[item][2][0]: 1072 hapVary.append(pfx+item+': 0')1072 hapVary.append(pfx+item+':i') 1073 1073 if hapData[item][0] == 'uniaxial': 1074 1074 controlDict[pfx+item+'Axis'] = hapData[item][3] 1075 hapDict[pfx+item+': 1'] = hapData[item][1][1]1075 hapDict[pfx+item+':a'] = hapData[item][1][1] 1076 1076 if hapData[item][2][1]: 1077 hapVary.append(pfx+item+': 1')1077 hapVary.append(pfx+item+':a') 1078 1078 else: #generalized for mustrain or ellipsoidal for size 1079 1079 if item == 'Mustrain': … … 1257 1257 for item in ['Mustrain','Size']: 1258 1258 if hapData[item][0] in ['isotropic','uniaxial']: 1259 hapData[item][1][0] = parmDict[pfx+item+': 0']1259 hapData[item][1][0] = parmDict[pfx+item+':i'] 1260 1260 if item == 'Size': 1261 1261 hapData[item][1][0] = min(10.,max(0.01,hapData[item][1][0])) 1262 if pfx+item+': 0' in sigDict:1263 SizeMuStrSig[item][0][0] = sigDict[pfx+item+': 0']1262 if pfx+item+':i' in sigDict: 1263 SizeMuStrSig[item][0][0] = sigDict[pfx+item+':i'] 1264 1264 if hapData[item][0] == 'uniaxial': 1265 hapData[item][1][1] = parmDict[pfx+item+': 1']1265 hapData[item][1][1] = parmDict[pfx+item+':a'] 1266 1266 if item == 'Size': 1267 1267 hapData[item][1][1] = min(10.,max(0.01,hapData[item][1][1])) 1268 if pfx+item+': 1' in sigDict:1269 SizeMuStrSig[item][0][1] = sigDict[pfx+item+': 1']1268 if pfx+item+':a' in sigDict: 1269 SizeMuStrSig[item][0][1] = sigDict[pfx+item+':a'] 1270 1270 else: #generalized for mustrain or ellipsoidal for size 1271 1271 for i in range(len(hapData[item][4])): … … 1899 1899 #crystallite size 1900 1900 if calcControls[phfx+'SizeType'] == 'isotropic': 1901 gam = 1.8*wave/(np.pi*parmDict[phfx+'Size: 0']*costh)1901 gam = 1.8*wave/(np.pi*parmDict[phfx+'Size:i']*costh) 1902 1902 elif calcControls[phfx+'SizeType'] == 'uniaxial': 1903 1903 H = np.array(refl[:3]) 1904 1904 P = np.array(calcControls[phfx+'SizeAxis']) 1905 1905 cosP,sinP = G2lat.CosSinAngle(H,P,G) 1906 gam = (1.8*wave/np.pi)/(parmDict[phfx+'Size: 0']*parmDict[phfx+'Size:1']*costh)1907 gam *= np.sqrt((sinP*parmDict[phfx+'Size: 1'])**2+(cosP*parmDict[phfx+'Size:0'])**2)1906 gam = (1.8*wave/np.pi)/(parmDict[phfx+'Size:i']*parmDict[phfx+'Size:a']*costh) 1907 gam *= np.sqrt((sinP*parmDict[phfx+'Size:a'])**2+(cosP*parmDict[phfx+'Size:i'])**2) 1908 1908 else: #ellipsoidal crystallites 1909 1909 Sij =[parmDict[phfx+'Size:%d'%(i)] for i in range(6)] … … 1913 1913 #microstrain 1914 1914 if calcControls[phfx+'MustrainType'] == 'isotropic': 1915 gam += 0.018*parmDict[phfx+'Mustrain: 0']*tand(refl[5]/2.)/np.pi1915 gam += 0.018*parmDict[phfx+'Mustrain:i']*tand(refl[5]/2.)/np.pi 1916 1916 elif calcControls[phfx+'MustrainType'] == 'uniaxial': 1917 1917 H = np.array(refl[:3]) 1918 1918 P = np.array(calcControls[phfx+'MustrainAxis']) 1919 1919 cosP,sinP = G2lat.CosSinAngle(H,P,G) 1920 Si = parmDict[phfx+'Mustrain: 0']1921 Sa = parmDict[phfx+'Mustrain: 1']1920 Si = parmDict[phfx+'Mustrain:i'] 1921 Sa = parmDict[phfx+'Mustrain:a'] 1922 1922 gam += 0.018*Si*Sa*tand(refl[5]/2.)/(np.pi*np.sqrt((Si*cosP)**2+(Sa*sinP)**2)) 1923 1923 else: #generalized - P.W. Stephens model … … 1935 1935 #crystallite size derivatives 1936 1936 if calcControls[phfx+'SizeType'] == 'isotropic': 1937 gamDict[phfx+'Size: 0'] = -1.80*wave/(np.pi*costh)1937 gamDict[phfx+'Size:i'] = -1.80*wave/(np.pi*costh) 1938 1938 elif calcControls[phfx+'SizeType'] == 'uniaxial': 1939 1939 H = np.array(refl[:3]) 1940 1940 P = np.array(calcControls[phfx+'SizeAxis']) 1941 1941 cosP,sinP = G2lat.CosSinAngle(H,P,G) 1942 Si = parmDict[phfx+'Size: 0']1943 Sa = parmDict[phfx+'Size: 1']1942 Si = parmDict[phfx+'Size:i'] 1943 Sa = parmDict[phfx+'Size:a'] 1944 1944 gami = (1.8*wave/np.pi)/(Si*Sa) 1945 1945 sqtrm = np.sqrt((sinP*Sa)**2+(cosP*Si)**2) 1946 1946 gam = gami*sqtrm/costh 1947 gamDict[phfx+'Size: 0'] = gami*Si*cosP**2/(sqtrm*costh)-gam/Si1948 gamDict[phfx+'Size: 1'] = gami*Sa*sinP**2/(sqtrm*costh)-gam/Sa1947 gamDict[phfx+'Size:i'] = gami*Si*cosP**2/(sqtrm*costh)-gam/Si 1948 gamDict[phfx+'Size:a'] = gami*Sa*sinP**2/(sqtrm*costh)-gam/Sa 1949 1949 else: #ellipsoidal crystallites 1950 1950 const = 1.8*wave/(np.pi*costh) … … 2608 2608 # cPickle.dump(pawleyLookup,file,1) 2609 2609 # file.close() 2610 return Rwp 2610 2611 2611 2612 def SeqRefine(GPXfile,dlg):
Note: See TracChangeset
for help on using the changeset viewer.