Changeset 367
- Timestamp:
- Sep 8, 2011 3:27:13 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIgrid.py
r365 r367 540 540 def OnFactor(event): 541 541 try: 542 value = min(max(float(Factr.GetValue()),0.00 1),100.)542 value = min(max(float(Factr.GetValue()),0.00001),100.) 543 543 except ValueError: 544 544 value = 1.0 545 545 data['shift factor'] = value 546 Factr.SetValue('%. 3f'%(value))546 Factr.SetValue('%.5f'%(value)) 547 547 548 548 if self.dataDisplay: … … 571 571 LSSizer.Add(Cnvrg,0,wx.ALIGN_CENTER_VERTICAL) 572 572 LSSizer.Add(wx.StaticText(self.dataDisplay,label=' Initial shift factor: '),0,wx.ALIGN_CENTER_VERTICAL) 573 Factr = wx.TextCtrl(self.dataDisplay,-1,value='%. 3f'%(data['shift factor']),style=wx.TE_PROCESS_ENTER)573 Factr = wx.TextCtrl(self.dataDisplay,-1,value='%.5f'%(data['shift factor']),style=wx.TE_PROCESS_ENTER) 574 574 Factr.Bind(wx.EVT_TEXT_ENTER,OnFactor) 575 575 Factr.Bind(wx.EVT_KILL_FOCUS,OnFactor) -
trunk/GSASIIphsGUI.py
r365 r367 2647 2647 PawleyPeaks = data['Pawley ref'] 2648 2648 rowLabels = [] 2649 for i in range(len(PawleyPeaks)): rowLabels.append(str(i +1))2649 for i in range(len(PawleyPeaks)): rowLabels.append(str(i)) 2650 2650 colLabels = ['h','k','l','mul','d','refine','Fsq(hkl)','sig(Fsq)'] 2651 2651 Types = 4*[wg.GRID_VALUE_LONG,]+[wg.GRID_VALUE_FLOAT+':10,4',wg.GRID_VALUE_BOOL,]+ \ … … 2671 2671 ext,mul = G2spc.GenHKLf([h,k,l],SGData)[:2] 2672 2672 if not ext: 2673 PawleyPeaks.append([h,k,l,mul,d,False,100 0.0,1.0])2673 PawleyPeaks.append([h,k,l,mul,d,False,100.0,1.0]) 2674 2674 finally: 2675 2675 wx.EndBusyCursor() -
trunk/GSASIIpwdGUI.py
r353 r367 1271 1271 for h,k,l,m,d,pos,sig,gam,fo,fc,x in data[self.RefList]: 1272 1272 refList.append([h,k,l,m,d,pos,sig,gam,fo,fc]) 1273 for i in range(len(refList)): rowLabels.append(str(i +1))1273 for i in range(len(refList)): rowLabels.append(str(i)) 1274 1274 colLabels = ['H','K','L','mul','d','pos','sig','gam','Fosq','Fcsq',] 1275 1275 Types = 4*[wg.GRID_VALUE_LONG,]+4*[wg.GRID_VALUE_FLOAT+':10,4',]+2*[wg.GRID_VALUE_FLOAT+':10,2',] … … 1278 1278 self.dataDisplay = G2gd.GSGrid(parent=self.dataFrame) 1279 1279 self.dataDisplay.SetTable(self.PeakTable, True) 1280 self.dataDisplay.EnableEditing(False) 1280 1281 self.dataDisplay.SetMargins(0,0) 1281 1282 self.dataDisplay.AutoSizeColumns(False) -
trunk/GSASIIstruct.py
r366 r367 727 727 'Size':[[0,0],[0 for i in range(len(hapData['Size'][4]))]]} 728 728 for item in ['Mustrain','Size']: 729 if hapData[item][0] in ['isotropic','uniaxial']: 729 if hapData[item][0] in ['isotropic','uniaxial']: 730 730 hapData[item][1][0] = parmDict[pfx+item+':0'] 731 if item == 'Size': 732 hapData[item][1][0] = min(10.,max(0.01,hapData[item][1][0])) 731 733 if hapData[item][2][0]: 732 734 SizeMuStrSig[item][0][0] = sigDict[pfx+item+':0'] 733 735 if hapData[item][0] == 'uniaxial': 734 736 hapData[item][1][1] = parmDict[pfx+item+':1'] 737 if item == 'Size': 738 hapData[item][1][1] = min(10.,max(0.01,hapData[item][1][1])) 735 739 if hapData[item][2][1]: 736 740 SizeMuStrSig[item][0][1] = sigDict[pfx+item+':1'] … … 1074 1078 def GetSampleGam(refl,wave,G,phfx,calcControls,parmDict,sizeEllipse): 1075 1079 costh = cosd(refl[5]/2.) 1080 #crystallite size 1076 1081 if calcControls[phfx+'SizeType'] == 'isotropic': 1077 1082 gam = 1.8*wave/(np.pi*parmDict[phfx+'Size:0']*costh) … … 1080 1085 P = np.array(calcControls[phfx+'SizeAxis']) 1081 1086 cosP,sinP = G2lat.CosSinAngle(H,P,G) 1082 gam = (1.8*wave/np.pi)/ parmDict[phfx+'Size:0']*parmDict[phfx+'Size:1']1083 gam *= np.sqrt((cosP*parmDict[phfx+'Size:1'])**2+(sinP*parmDict[phfx+'Size:0'])**2) /costh1087 gam = (1.8*wave/np.pi)/(parmDict[phfx+'Size:0']*parmDict[phfx+'Size:1']*costh) 1088 gam *= np.sqrt((cosP*parmDict[phfx+'Size:1'])**2+(sinP*parmDict[phfx+'Size:0'])**2) 1084 1089 else: #ellipsoidal crystallites - wrong not make sense 1085 1090 H = np.array(refl[:3]) 1086 gam += 1.8*wave/(np.pi*costh*np.inner(H,np.inner(sizeEllipse,H))) 1091 gam += 1.8*wave/(np.pi*costh*np.inner(H,np.inner(sizeEllipse,H))) 1092 #microstrain 1087 1093 if calcControls[phfx+'MustrainType'] == 'isotropic': 1088 1094 gam += 0.018*parmDict[phfx+'Mustrain:0']*tand(refl[5]/2.)/np.pi … … 1191 1197 iBeg = np.searchsorted(x,pos2-fmin) 1192 1198 iFin = np.searchsorted(x,pos2+fmax) 1199 if not iBeg+iFin: #peak below low limit - skip peak 1200 continue 1201 elif not iBeg-iFin: #peak above high limit - done 1202 return yc,yb 1193 1203 yc[iBeg:iFin] += Icorr*refl[8]*kRatio*G2pwd.getFCJVoigt3(pos2,refl[6],refl[7],shl,x[iBeg:iFin]) #and here 1194 1204 else: … … 1202 1212 costh = cosd(refl[5]/2.) 1203 1213 tanth = tand(refl[5]/2.) 1214 #crystallite size derivatives 1204 1215 if calcControls[phfx+'SizeType'] == 'isotropic': 1205 gam = 180.*wave/(np.pi*parmDict[phfx+'Size:0']*costh) 1206 gamDict[phfx+'Size:0'] = gam/parmDict[phfx+'Size:0'] 1216 gamDict[phfx+'Size:0'] = 1.80*wave/(np.pi*costh) 1207 1217 elif calcControls[phfx+'SizeType'] == 'uniaxial': 1208 1218 H = np.array(refl[:3]) … … 1215 1225 gam = gami*sqtrm/costh 1216 1226 gamDict[phfx+'Size:0'] = gami*Si*sinP**2/(sqtrm*costh)-gam/Si 1217 gamDict[phfx+'Size:1'] = gam /Sa-gami*Sa*cosP**2/(sqtrm*costh)1227 gamDict[phfx+'Size:1'] = gami*Sa*cosP**2/(sqtrm*costh)-gam/Sa 1218 1228 else: #ellipsoidal crystallites - do numerically? - not right not make sense 1219 1229 H = np.array(refl[:3]) 1220 1230 gam = 1.8*wave/(np.pi*costh*np.inner(H,np.inner(sizeEllipse,H))) 1221 1231 #microstrain derivatives 1222 1232 if calcControls[phfx+'MustrainType'] == 'isotropic': 1223 1233 gamDict[phfx+'Mustrain:0'] = 0.018*tanth/np.pi
Note: See TracChangeset
for help on using the changeset viewer.