# Changeset 1480

Ignore:
Timestamp:
Aug 27, 2014 12:59:17 PM (8 years ago)
Message:

reset mustrain now gives correct SHKL coefficients for a 1000 mustrain
generalized mustrain now scaled correctly by 0.018/pi

Location:
trunk
Files:
4 edited

Unmodified
Removed
• ## trunk/GSASIIddataGUI.py

 r1478 UseList[item]['Mustrain'][1][1] = 1000.0 elif name == 'generalized': muiso = 1000. cell = generalData['Cell'][1:7] vals = G2spc.Muiso2Shkl(muiso,SGData,cell) nTerm = len(UseList[item]['Mustrain'][4]) for i in range(nTerm): UseList[item]['Mustrain'][4][i] = 0.01 UseList[item]['Mustrain'][4][i] = vals[i] G2plt.PlotSizeStrainPO(G2frame,data) wx.CallAfter(UpdateDData,G2frame,DData,data)
• ## trunk/GSASIIplot.py

 r1475 uvw = np.inner(A.T,xyz) Strm = np.array(G2spc.MustrainCoeff(uvw,SGData)) sum = np.sum(np.multiply(Shkl,Strm)) sum = np.where(sum > 0.01,sum,0.01) sum = np.sqrt(sum)*math.pi/.18      #centidegrees to radians! return sum*xyz Sum = np.sum(np.multiply(Shkl,Strm)) Sum = np.where(Sum > 0.01,Sum,0.01) Sum = np.sqrt(Sum) return Sum*xyz Shkl = np.array(coeff[4])
• ## trunk/GSASIIspc.py

 r1471 import numpy.ma as ma import numpy.linalg as nl import scipy.optimize as so import math import sys GSASIIpath.SetVersionNumber("\$Revision\$") import pyspg npsind = lambda x: np.sin(x*np.pi/180.) npcosd = lambda x: np.cos(x*np.pi/180.) def SpcGroup(SGSymbol): def Muiso2Shkl(muiso,SGData,cell): "this is to convert isotropic mustrain to generalized Shkls - doesn't work just now" "this is to convert isotropic mustrain to generalized Shkls" import GSASIIlattice as G2lat from scipy.optimize import fmin A = G2lat.cell2AB(cell)[0] def minMus(Shkl,H,muiso,SGData,A): def minMus(Shkl,muiso,H,SGData,A): U = np.inner(A.T,H) S = np.array(MustrainCoeff(H.T,SGData)) sum = np.sqrt(np.sum(np.multiply(S,Shkl))) return abs(muiso-sum*H) S = np.array(MustrainCoeff(U,SGData)) Sum = np.sqrt(np.sum(np.multiply(S,Shkl[:,np.newaxis]),axis=0)) rad = np.sqrt(np.sum((Sum[:,np.newaxis]*H)**2,axis=1)) return (muiso-rad)**2 laue = SGData['SGLaue'] PHI = np.linspace(0.,360.,60,True) PSI = np.linspace(0.,180.,60,True) X = np.outer(npsind(PHI),npsind(PSI)) Y = np.outer(npcosd(PHI),npsind(PSI)) Z = np.outer(np.ones(np.size(PHI)),npcosd(PSI)) HKL = np.dstack((X,Y,Z)) if laue in ['m3','m3m']: H = [[1,0,0],[1,1,0]] S0 = [0.01,0.01] S0 = [1000.,1000.] elif laue in ['6/m','6/mmm','3m1']: H = [[1,0,0],[0,0,1],[1,0,1]] S0 = [0.01,0.01,0.01] S0 = [1000.,1000.,1000.] elif laue in ['31m','3']: H = [[1,0,0],[0,0,1],[1,0,1],[1,1,1]] S0 = [0.01,0.01,0.01,0.01] S0 = [1000.,1000.,1000.,1000.] elif laue in ['3R','3mR']: H = [[1,0,0],[1,1,0],[1,0,1],[1,1,1]] S0 = [0.01,0.01,0.01,0.01] S0 = [1000.,1000.,1000.,1000.] elif laue in ['4/m','4/mmm']: H = [[1,0,0],[0,0,1],[1,1,0],[1,0,1]] S0 = [0.01,0.01,0.01,0.01] S0 = [1000.,1000.,1000.,1000.] elif laue in ['mmm']: H = [[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1]] S0 = [0.01,0.01,0.01,0.01,0.01,0.01] S0 = [1000.,1000.,1000.,1000.,1000.,1000.] elif laue in ['2/m']: H = [[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1]] if uniq == 'a': H.append([0,1,-1]) H.append([0,-2,1]) elif uniq == 'b': H.append([1,0,-1]) H.append([-2,0,1]) elif uniq == 'c': H.append([1,-1,0]) H.append([-2,1,0]) H.append([1,1,1]) S0 = [9*[0.01,]] S0 = [1000.,1000.,1000.,0.,0.,0.,0.,0.,0.] else: H = [[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1], [-1,1,0],[1,0,-1],[0,-1,1],[1,-2,0],[-2,0,1],[0,1,-2], [1,-1,1],[-1, 1, 1],[1,-1,1]] S0 = [15*[0.01,]] H = np.array(H) S0 = [1000.,1000.,1000.,1000.,1000., 1000.,1000.,1000.,1000.,1000., 1000.,1000.,0.,0.,0.] S0 = np.array(S0) return fmin(minMus,S0,(H,muiso,SGData,A)) HKL = np.reshape(HKL,(-1,3)) result = so.leastsq(minMus,S0,(np.ones(HKL.shape[0])*muiso,HKL,SGData,A)) return result[0] def SytSym(XYZ,SGData):
• ## trunk/GSASIIstrMath.py

 r1479 for i,strm in enumerate(Strms): Sum += parmDict[phfx+'Mustrain:'+str(i)]*strm Mgam = refl[4]**2*tand(refl[5]/2.)*np.sqrt(Sum) Mgam = 0.018*refl[4]**2*tand(refl[5]/2.)*np.sqrt(Sum)/np.pi elif 'T' in calcControls[hfx+'histType']: #crystallite size sigDict[phfx+'Mustrain;a'] = 2*(Mgam/Sa+dsa)*Mgam*(1.-parmDict[phfx+'Mustrain;mx'])**2/ateln2 else:       #generalized - P.W. Stephens model const = refl[4]**2*tanth const = 0.018*refl[4]**2*tanth/np.pi Strms = G2spc.MustrainCoeff(refl[:3],SGData) Sum = 0
Note: See TracChangeset for help on using the changeset viewer.