Changeset 3242
 Timestamp:
 Jan 24, 2018 9:35:01 AM (4 years ago)
 Location:
 trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIddataGUI.py
r3233 r3242 209 209 if UseList[G2frame.hist]['Mustrain'][0] == 'generalized': 210 210 Obj.SetValue("%.1f"%(UseList[G2frame.hist]['Mustrain'][4][pid])) #reset in case of error 211 wx.CallLater(100,RepaintHistogramInfo,DData.GetScrollPos(wx.VERTICAL)) 211 212 else: 212 213 Obj.SetValue("%.1f"%(UseList[G2frame.hist]['Mustrain'][1][pid])) #reset in case of error … … 412 413 413 414 def GenStrainDataSizer(): 415 muMean = G2spc.MuShklMean(SGData,Amat,UseList[G2frame.hist]['Mustrain'][4]) 414 416 Snames = G2spc.MustrainNames(SGData) 415 417 numb = len(Snames) … … 432 434 strainVal.Bind(wx.EVT_KILL_FOCUS,OnStrainVal) 433 435 dataSizer.Add(strainVal,0,WACV) 436 dataSizer.Add(wx.StaticText(DData,label=' Mean mustrain %.1f'%muMean),0,WACV) 434 437 return dataSizer 435 438 … … 995 998 G2frame.dataWindow.HistsInPhase = [name for name in keyList if name in UseList] 996 999 generalData = data['General'] 1000 cell = generalData['Cell'][1:] 1001 Amat,Bmat = G2lat.cell2AB(cell[:6]) 997 1002 PhaseName = generalData['Name'] 998 1003 SGData = generalData['SGData'] 
trunk/GSASIIspc.py
r3239 r3242 2693 2693 Strm.append(4.0*k*h*l**2) 2694 2694 return Strm 2695 2696 def MuShklMean(SGData,Amat,Shkl): 2697 2698 def genMustrain(xyz,Shkl): 2699 uvw = np.inner(Amat.T,xyz) 2700 Strm = np.array(MustrainCoeff(uvw,SGData)) 2701 Sum = np.sum(np.multiply(Shkl,Strm)) 2702 Sum = np.where(Sum > 0.01,Sum,0.01) 2703 Sum = np.sqrt(Sum) 2704 return Sum*xyz 2705 2706 PHI = np.linspace(0.,360.,30,True) 2707 PSI = np.linspace(0.,180.,30,True) 2708 X = np.outer(npcosd(PHI),npsind(PSI)) 2709 Y = np.outer(npsind(PHI),npsind(PSI)) 2710 Z = np.outer(np.ones(np.size(PHI)),npcosd(PSI)) 2711 XYZ = np.dstack((X,Y,Z)) 2712 XYZ = np.nan_to_num(np.apply_along_axis(genMustrain,2,XYZ,Shkl)) 2713 return np.sqrt(np.sum(XYZ**2)/900.) 2714 2695 2715 2696 2716 def Muiso2Shkl(muiso,SGData,cell):
Note: See TracChangeset
for help on using the changeset viewer.