Changeset 1625
- Timestamp:
- Jan 8, 2015 4:24:32 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r1621 r1625 3373 3373 rbVary,rbDict = G2stIO.GetRigidBodyModels(rigidbodyDict,Print=False) 3374 3374 rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]}) 3375 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtable,BLtable = G2stIO.GetPhaseData(Phases,RestraintDict=None,rbIds=rbIds,Print=False)3375 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtable,BLtable,maxSSwave = G2stIO.GetPhaseData(Phases,RestraintDict=None,rbIds=rbIds,Print=False) 3376 3376 hapVary,hapDict,controlDict = G2stIO.GetHistogramPhaseData(Phases,Histograms,Print=False) 3377 3377 histVary,histDict,controlDict = G2stIO.GetHistogramData(Histograms,Print=False) -
trunk/GSASIIIO.py
r1619 r1625 2057 2057 self.parmDict.update(rbDict) 2058 2058 rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]}) 2059 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables = G2stIO.GetPhaseData(2059 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,maxSSwave = G2stIO.GetPhaseData( 2060 2060 Phases,RestraintDict=None,rbIds=rbIds,Print=False) 2061 2061 self.parmDict.update(phaseDict) -
trunk/GSASIIconstrGUI.py
r1619 r1625 235 235 236 236 # create a list of the phase variables 237 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtable,BLtable = G2stIO.GetPhaseData(Phases,rbIds=rbIds,Print=False)237 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtable,BLtable,maxSSwave = G2stIO.GetPhaseData(Phases,rbIds=rbIds,Print=False) 238 238 phaseList = [] 239 239 for item in phaseDict: -
trunk/GSASIImath.py
r1622 r1625 42 42 atand = lambda x: 180.*np.arctan(x)/np.pi 43 43 atan2d = lambda y,x: 180.*np.arctan2(y,x)/np.pi 44 45 ################################################################################ 46 ##### Hessian least-squares Levenberg-Marquardt routine 47 ################################################################################ 44 48 45 49 def HessianLSQ(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.49012e-8, maxcyc=0,Print=False): … … 194 198 # vcov[i1][i2] = 0.0 195 199 return vcov 200 201 ################################################################################ 202 ##### Atom manipulations 203 ################################################################################ 196 204 197 205 def FindAtomIndexByIDs(atomData,IDs,Draw=True): … … 697 705 return Xanom 698 706 707 def posFourier(tau,psin,pcos): 708 A = np.array([ps[:,np.newaxis]*np.sin(2*np.pi*(i+1)*tau) for i,ps in enumerate(psin)]) 709 B = np.array([pc[:,np.newaxis]*np.cos(2*np.pi*(i+1)*tau) for i,pc in enumerate(pcos)]) 710 return np.sum(A,axis=0)+np.sum(B,axis=0) 711 712 def posSawtooth(tau,Toff,slopes): 713 Tau = (tau-Toff)%1. 714 A = slopes[:,np.newaxis]*Tau 715 return A 716 717 def posZigZag(tau,Toff,slopes): 718 Tau = (tau-Toff)%1. 719 A = np.where(Tau <= 0.5,slopes[:,np.newaxis]*Tau,slopes[:,np.newaxis]*(1.-Tau)) 720 return A 721 722 def fracCrenel(tau,Toff,Twid): 723 Tau = (tau-Toff)%1. 724 A = np.where(Tau<Twid,1.,0.) 725 return A 726 727 def fracFourier(tau,fsin,fcos): 728 A = np.array([fs[:,np.newaxis]*np.sin(2.*np.pi*(i+1)*tau) for i,fs in enumerate(fsin)]) 729 B = np.array([fc[:,np.newaxis]*np.cos(2.*np.pi*(i+1)*tau) for i,fc in enumerate(fcos)]) 730 return np.sum(A,axis=0)+np.sum(B,axis=0) 699 731 700 732 ################################################################################ 701 ##### distance, angle, planes, torsion stuff stuff733 ##### distance, angle, planes, torsion stuff 702 734 ################################################################################ 703 735 -
trunk/GSASIIobj.py
r1614 r1625 1296 1296 # supersymmetry parameters p::<var>:a:o 'Flen','Fcent'? 1297 1297 'mV([0-2])$' : 'Modulation vector component \\1', 1298 'Fsin$' : 'Sin site fraction modulation', 1299 'Fcos$' : 'Cos site fraction modulation', 1298 'Fsin' : 'Sin site fraction modulation', 1299 'Fcos' : 'Cos site fraction modulation', 1300 'Fzero' : 'Crenel function offset', 1301 'Fwid' : 'Crenel function width', 1302 'Tzero' : 'Sawtooth/ZigZag location', 1303 '([XYZ])slope': 'Sawtooth/ZigZag slope for \\1', 1300 1304 '([XYZ])sin' : 'Sin position wave for \\1', 1301 1305 '([XYZ])cos' : 'Cos position wave for \\1', -
trunk/GSASIIphsGUI.py
r1623 r1625 2005 2005 def UpdateWavesData(): 2006 2006 2007 generalData = data['General'] 2008 cx,ct,cs,cia = generalData['AtomPtrs'] 2009 2007 2010 def AtomSizer(SS,atom): 2008 2011 2009 2012 def OnWaveType(event): 2010 2013 atom[-1][SS]['waveType']=waveType.GetValue() 2014 atom[-1][SS]['Spos'] = [] 2015 UpdateWavesData() 2011 2016 2012 2017 def OnShowWave(event): … … 2017 2022 2018 2023 atomSizer = wx.BoxSizer(wx.HORIZONTAL) 2019 atomSizer.Add(wx.StaticText(waveData,label=' Modulation data for atom: '+atom[0]+' WaveType: '),0,WACV) 2024 atomSizer.Add(wx.StaticText(waveData,label= 2025 ' Modulation data for atom: %s Site sym: %s WaveType: '%(atom[0],atom[cs].strip())),0,WACV) 2020 2026 waveType = wx.ComboBox(waveData,value=atom[-1][SS]['waveType'],choices=waveTypes, 2021 2027 style=wx.CB_READONLY|wx.CB_DROPDOWN) … … 2032 2038 return atomSizer 2033 2039 2034 def WaveSizer(wave Blk,Stype,typeName,Names,waveCSI):2040 def WaveSizer(waveType,waveBlk,Stype,typeName,Names): 2035 2041 2036 2042 def OnAddWave(event): 2037 2043 Obj = event.GetEventObject() 2038 2044 iatm,item = Indx[Obj.GetId()] 2039 atomData[iatm][-1][SS][item].append([[0.0 for i in range(numVals[Stype])],False]) 2045 nt = numVals[Stype] 2046 if not len(atomData[iatm][-1][SS][item]) and waveType in ['ZigZag','Sawtooth'] and Stype == 'Spos': 2047 nt = 4 2048 atomData[iatm][-1][SS][item].append([[0.0 for i in range(nt)],False]) 2040 2049 UpdateWavesData() 2041 2050 … … 2070 2079 waveSizer.Add(waveHead) 2071 2080 if len(waveBlk): 2072 waveSizer.Add(wx.StaticText(waveData,label=' Parameters: '+str(Names).rstrip(']').lstrip('[').replace("'",'')),0,WACV) 2073 if Stype == 'Sfrac': 2074 Waves = wx.FlexGridSizer(1,4,5,5) 2075 else: 2076 Waves = wx.FlexGridSizer(1,8,5,5) 2081 CSI = G2spc.GetSSfxuinel(xyz,uij,SGData,SSGData) 2077 2082 for iwave,wave in enumerate(waveBlk): 2083 waveName = 'Fourier' 2084 if Stype == 'Sfrac': 2085 if 'Crenel' in waveType and not iwave: 2086 waveName = 'Crenel' 2087 names = Names[2:] 2088 else: 2089 names = Names[:2] 2090 Waves = wx.FlexGridSizer(1,4,5,5) 2091 elif Stype == 'Spos': 2092 if waveType in ['ZigZag','Sawtooth'] and not iwave: 2093 names = Names[6:] 2094 Waves = wx.FlexGridSizer(1,6,5,5) 2095 waveName = waveType 2096 else: 2097 names = Names[:6] 2098 Waves = wx.FlexGridSizer(1,8,5,5) 2099 else: 2100 names = Names 2101 Waves = wx.FlexGridSizer(1,8,5,5) 2102 waveSizer.Add(wx.StaticText(waveData,label=' %s parameters: %s'%(waveName,str(names).rstrip(']').lstrip('[').replace("'",''))),0,WACV) 2078 2103 for ival,val in enumerate(wave[0]): 2079 if waveCSI[0][ival] == 0:2104 if CSI[Stype][0][ival] == 0: 2080 2105 waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_READONLY) 2081 2106 waveVal.SetBackgroundColour(VERY_LIGHT_GREY) … … 2094 2119 waveRef.Bind(wx.EVT_CHECKBOX, OnRefWave) 2095 2120 Waves.Add(waveRef,0,WACV) 2096 waveDel = wx.CheckBox(waveData,label='Delete?') 2097 Indx[waveDel.GetId()] = [iatm,Stype,iwave] 2098 waveDel.Bind(wx.EVT_CHECKBOX, OnDelWave) 2099 Waves.Add(waveDel,0,WACV) 2100 waveSizer.Add(Waves) 2121 if iwave < len(waveBlk)-1: 2122 Waves.Add((5,5),0) 2123 else: 2124 waveDel = wx.CheckBox(waveData,label='Delete?') 2125 Indx[waveDel.GetId()] = [iatm,Stype,iwave] 2126 waveDel.Bind(wx.EVT_CHECKBOX, OnDelWave) 2127 Waves.Add(waveDel,0,WACV) 2128 waveSizer.Add(Waves) 2101 2129 return waveSizer 2102 2130 … … 2139 2167 typeNames = {'Sfrac':' Site fraction','Spos':' Position','Sadp':' Thermal motion','Smag':' Magnetic moment'} 2140 2168 numVals = {'Sfrac':2,'Spos':6,'Sadp':12,'Smag':6} 2141 posNames = ['Xsin','Ysin','Zsin','Xcos','Ycos','Zcos' ]2169 posNames = ['Xsin','Ysin','Zsin','Xcos','Ycos','Zcos','Tzero','Xslope','Yslope','Zslope'] 2142 2170 adpNames = ['U11sin','U22sin','U33sin','U12sin','U13sin','U23sin', 2143 2171 'U11cos','U22cos','U33cos','U12cos','U13cos','U23cos'] 2144 2172 magNames = ['MXsin','MYsin','MZsin','MXcos','MYcos','MZcos'] 2145 fracNames = ['F len','Fcent','Fsin','Fcos']2173 fracNames = ['Fsin','Fcos','Fzero','Fwid'] 2146 2174 waveTypes = ['Fourier','Sawtooth','ZigZag','Crenel/Fourier'] 2147 2175 Labels = {'Spos':posNames,'Sfrac':fracNames,'Sadp':adpNames,'Smag':magNames} … … 2152 2180 xyz = atom[cx:cx+3] 2153 2181 uij = atom[cia+2:cia+8] 2154 CSI = G2spc.GetSSfxuinel(xyz,uij,SGData,SSGData)2155 2182 for SS in ['SS1',]: #future SS2 & SS3 - I doubt it! 2156 2183 G2gd.HorizontalLine(mainSizer,waveData) … … 2161 2188 if generalData['Type'] != 'magnetic' and Stype == 'Smag': 2162 2189 break 2163 mainSizer.Add(WaveSizer(atom[-1][SS][ Stype],Stype,typeNames[Stype],Labels[Stype],CSI[Stype]))2190 mainSizer.Add(WaveSizer(atom[-1][SS]['waveType'],atom[-1][SS][Stype],Stype,typeNames[Stype],Labels[Stype])) 2164 2191 2165 2192 SetPhaseWindow(G2frame.dataFrame,waveData,mainSizer) … … 5786 5813 G2frame.dataFrame.Bind(wx.EVT_MENU, OnIsoDistortCalc, id=G2gd.wxID_ISODISP) 5787 5814 for id in G2frame.dataFrame.ReImportMenuId: #loop over submenu items 5788 G2frame.dataFrame.Bind(wx.EVT_MENU, OnReImport, id=id) 5815 G2frame.dataFrame.Bind(wx.EVT_MENU, OnReImport, id=id) 5789 5816 # Wave Data 5790 5817 if data['General']['Type'] in ['modulated','magnetic']: -
trunk/GSASIIplot.py
r1623 r1625 62 62 npatand = lambda x: 180.*np.arctan(x)/np.pi 63 63 npatan2d = lambda x,y: 180.*np.arctan2(x,y)/np.pi 64 GkDelta = unichr(0x0394) 64 65 65 66 class G2PlotMpl(wx.Panel): … … 2771 2772 2772 2773 ################################################################################ 2773 ##### Modulation Plot2774 ##### Plot Modulation 2774 2775 ################################################################################ 2775 2776 2776 def ModulationPlot(G2frame,data,atom,Ax): 2777 def ModulationPlot(G2frame,data,atom,ax,off=0): 2778 global Off,Atom,Ax 2779 Off = off 2780 Atom = atom 2781 Ax = ax 2782 def OnMotion(event): 2783 xpos = event.xdata 2784 if xpos: #avoid out of frame mouse position 2785 ypos = event.ydata 2786 Page.canvas.SetCursor(wx.CROSS_CURSOR) 2787 try: 2788 G2frame.G2plotNB.status.SetStatusText('t =%9.3f %s =%9.3f'%(xpos,GkDelta+Ax,ypos),1) 2789 except TypeError: 2790 G2frame.G2plotNB.status.SetStatusText('Select '+Title+' pattern first',1) 2777 2791 2792 def OnPlotKeyPress(event): 2793 global Off,Atom,Ax 2794 newPlot = False 2795 if event.key == '0': 2796 Off = 0 2797 elif event.key == '+': 2798 Off += 1 2799 elif event.key == '-': 2800 Off -= 1 2801 wx.CallAfter(ModulationPlot,G2frame,data,Atom,Ax,Off) 2802 2778 2803 try: 2779 2804 plotNum = G2frame.G2plotNB.plotList.index('Modulation') … … 2787 2812 plotNum = G2frame.G2plotNB.plotList.index('Modulation') 2788 2813 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 2789 # Page.canvas.mpl_connect('motion_notify_event', OnMotion) 2790 2814 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 2815 Page.canvas.mpl_connect('key_press_event', OnPlotKeyPress) 2816 2817 Page.Choice = ['+: shift up','-: shift down','0: reset'] 2818 Page.keyPress = OnPlotKeyPress 2819 Page.SetFocus() 2791 2820 General = data['General'] 2792 2821 cx,ct,cs,cia = General['AtomPtrs'] … … 2795 2824 rhoSize = np.array(Map['rho'].shape) 2796 2825 atxyz = np.array(atom[cx:cx+3]) 2826 waveType = atom[-1]['SS1']['waveType'] 2827 Spos = atom[-1]['SS1']['Spos'] 2828 tau = np.linspace(0.,2.,101) 2829 wave = np.zeros((3,101)) 2830 if len(Spos): 2831 scof = [] 2832 ccof = [] 2833 for i,spos in enumerate(Spos): 2834 if waveType in ['Sawtooth','ZigZag'] and not i: 2835 Toff = spos[0][0] 2836 slopes = np.array(spos[0][1:]) 2837 if waveType == 'Sawtooth': 2838 wave = G2mth.posSawtooth(tau,Toff,slopes) 2839 elif waveType == 'ZigZag': 2840 wave = G2mth.posZigZag(tau,Toff,slopes) 2841 else: 2842 scof.append(spos[0][:3]) 2843 ccof.append(spos[0][3:]) 2844 wave += G2mth.posFourier(tau,np.array(scof),np.array(ccof)) 2797 2845 Title = MapType+' modulation map for atom '+atom[0]+ \ 2798 2846 ' at %.4f %.4f %.4f'%(atxyz[0],atxyz[1],atxyz[2]) … … 2805 2853 if Ax == 'x': 2806 2854 slab = np.sum(np.sum(rho[:,ix[1]-ib:ix[1]+ib,ix[2]-ib:ix[2]+ib,:],axis=2),axis=1) 2855 Plot.plot(wave[0],tau) 2807 2856 elif Ax == 'y': 2808 2857 slab = np.sum(np.sum(rho[ix[0]-ib:ix[0]+ib,:,ix[2]-ib:ix[2]+ib,:],axis=2),axis=0) 2858 Plot.plot(wave[1],tau) 2809 2859 elif Ax == 'z': 2810 2860 slab = np.sum(np.sum(rho[ix[0]-ib:ix[0]+ib,ix[1]-ib:ix[1]+ib,:,:],axis=1),axis=0) 2861 Plot.plot(wave[2],tau) 2811 2862 Plot.set_title(Title) 2812 2863 Plot.set_xlabel('t') 2813 2864 Plot.set_ylabel(r'$\mathsf{\Delta}$%s'%(Ax)) 2814 Slab = np.concatenate((slab,slab),axis=1) 2815 Plot.contour(Slab,20,extent=(0.,2.,-.5,.5)) 2865 Slab = np.concatenate((slab,slab),axis=1).T 2866 Plot.contour(Slab,20,extent=(-.5+Off*.005,.5+Off*.005,0.,2.)) 2867 2816 2868 Page.canvas.draw() 2817 2869 2818 2870 ################################################################################ 2819 2871 ##### PlotCovariance … … 4025 4077 if 'Flip' in generalData: 4026 4078 flipData = generalData['Flip'] 4027 flipData['mapRoll'] = [0,0,0]4028 4079 Wt = np.array([255,255,255]) 4029 4080 Rd = np.array([255,0,0]) -
trunk/GSASIIspc.py
r1615 r1625 1455 1455 CSI['Spos'][0] = [1,2,3, 0,0,0] 1456 1456 CSI['Sadp'][0] = [0,0,0,0,0,0, 1,2,3,4,5,6] 1457 return CSI 1458 print siteSym,OpText,SSOptext 1457 return CSI 1458 return CSI #for now 1459 # print siteSym,OpText,SSOptext 1459 1460 UniqAx = {'a':'a','b':'b','c':'g'} 1460 1461 if SGData['SGLaue'] == '2/m': … … 1532 1533 csi = np.ones((6),dtype='i')*-1 1533 1534 for i,idelt in enumerate(deltx): 1534 print 'idelt:',idelt1535 # print 'idelt:',idelt 1535 1536 nxyzt = np.inner(ssop[0],(xyzt+idelt))+ssop[1] 1536 1537 nxyzt[3] -= ssop[1][3] 1537 print 'nxyz',nxyzt1538 # print 'nxyz',nxyzt 1538 1539 xsin[i] = np.allclose((xyzt-idelt),nxyzt,1.e-6) 1539 print 'sin ',(xyzt-idelt),xsin[i]1540 # print 'sin ',(xyzt-idelt),xsin[i] 1540 1541 xcos[i] = np.allclose((xyzt+idelt),nxyzt,1.e-6) 1541 print 'cos ',(xyzt+idelt),xcos[i]1542 # print 'cos ',(xyzt+idelt),xcos[i] 1542 1543 n = -1 1543 1544 for i,isin in enumerate(xsin): … … 1549 1550 n += 1 1550 1551 csi[i+3] = n 1551 print csi1552 print CSI['Spos'][0]1553 print xsin,xcos1552 # print csi 1553 # print CSI['Spos'][0] 1554 # print xsin,xcos 1554 1555 for i,idelt in enumerate(deltu): 1555 1556 nuij = U2Uij(np.inner(sop[0],np.inner(np.abs(Uij2U(uij+idelt)),sop[0]))) 1556 1557 usin[i] = np.equal(np.abs(uij-idelt),nuij)[i] 1557 1558 ucos[i] = np.equal(np.abs(uij+idelt),nuij)[i] 1558 print CSI['Sadp'][0]1559 print usin,ucos1559 # print CSI['Sadp'][0] 1560 # print usin,ucos 1560 1561 return CSI 1561 1562 -
trunk/GSASIIstrIO.py
r1618 r1625 189 189 rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]}) 190 190 rbVary,rbDict = GetRigidBodyModels(rigidbodyDict,Print=False) 191 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables = GetPhaseData(Phases,RestraintDict=None,rbIds=rbIds,Print=False)191 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,maxSSwave = GetPhaseData(Phases,RestraintDict=None,rbIds=rbIds,Print=False) 192 192 hapVary,hapDict,controlDict = GetHistogramPhaseData(Phases,Histograms,Print=False) 193 193 histVary,histDict,controlDict = GetHistogramData(Histograms,Print=False) … … 859 859 cx,ct,cs,cia = General['AtomPtrs'] 860 860 print >>pFile,'\n Modulation waves' 861 names = {'Sfrac':['Fsin','Fcos' ],'Spos':['Xsin','Ysin','Zsin','Xcos','Ycos','Zcos'],861 names = {'Sfrac':['Fsin','Fcos','Fzero','Fwid'],'Spos':['Xsin','Ysin','Zsin','Xcos','Ycos','Zcos','Tzero','Xslope','Yslope','Zslope'], 862 862 'Sadp':['U11sin','U22sin','U33sin','U12sin','U13sin','U23sin','U11cos','U22cos', 863 863 'U33cos','U12cos','U13cos','U23cos'],'Smag':['MXsin','MYsin','MZsin','MXcos','MYcos','MZcos']} … … 974 974 AtMults = {} 975 975 AtIA = {} 976 maxSSwave = {} 976 977 shModels = ['cylindrical','none','shear - 2/m','rolling - mmm'] 977 978 SamSym = dict(zip(shModels,['0','-1','2/m','mmm'])) … … 1024 1025 1025 1026 Natoms[pfx] = 0 1026 maxSSwave = {'Sfrac':0,'Spos':0,'Sadp':0,'Smag':0}1027 maxSSwave[pfx] = {'Sfrac':0,'Spos':0,'Sadp':0,'Smag':0} 1027 1028 if Atoms and not General.get('doPawley'): 1028 1029 cx,ct,cs,cia = General['AtomPtrs'] … … 1089 1090 if General['Type'] in ['modulated','magnetic']: 1090 1091 AtomSS = at[-1]['SS1'] 1092 waveType = AtomSS['waveType'] 1093 phaseDict[pfx+'waveType:'+str(i)] = waveType 1091 1094 CSI = G2spc.GetSSfxuinel(at[cx:cx+3],at[cia+2:cia+8],SGData,SSGData) 1092 1095 for Stype in ['Sfrac','Spos','Sadp','Smag']: … … 1096 1099 stiw = str(i)+':'+str(iw) 1097 1100 if Stype == 'Spos': 1098 names = [pfx+'Xsin:'+stiw,pfx+'Ysin:'+stiw,pfx+'Zsin:'+stiw, 1099 pfx+'Xcos:'+stiw,pfx+'Ycos:'+stiw,pfx+'Zcos:'+stiw] 1100 equivs = [[],[],[], [],[],[]] 1101 if waveType in ['ZigZag','Sawtooth'] and not iw: 1102 names = [pfx+'Tzero:'+stiw,pfx+'Xslope:'+stiw,pfx+'Yslope:'+stiw,pfx+'Zslope:'+stiw] 1103 equivs = [[], [],[],[]] 1104 else: 1105 names = [pfx+'Xsin:'+stiw,pfx+'Ysin:'+stiw,pfx+'Zsin:'+stiw, 1106 pfx+'Xcos:'+stiw,pfx+'Ycos:'+stiw,pfx+'Zcos:'+stiw] 1107 equivs = [[],[],[], [],[],[]] 1101 1108 elif Stype == 'Sadp': 1102 1109 names = [pfx+'U11sin:'+stiw,pfx+'U22sin:'+stiw,pfx+'U33sin:'+stiw, … … 1107 1114 elif Stype == 'Sfrac': 1108 1115 equivs = [[],[]] 1109 names = [pfx+'Fsin:'+stiw,pfx+'Fcos:'+stiw] 1116 if 'Crenel' in waveType and not iw: 1117 names = [pfx+'Fzero:'+stiw,pfx+'Fwid:'+stiw] 1118 else: 1119 names = [pfx+'Fsin:'+stiw,pfx+'Fcos:'+stiw] 1110 1120 elif Stype == 'Smag': 1111 1121 equivs = [[],[],[], [],[],[]] … … 1125 1135 eqv[1] /= coef 1126 1136 G2mv.StoreEquivalence(name,equiv[1:]) 1127 maxSSwave['Stype'] = max(maxSSwave['Stype'],iw+1) 1128 phaseDict[pfx+'maxSSwave'] = maxSSwave 1137 maxSSwave[pfx][Stype] = max(maxSSwave[Stype],iw+1) 1129 1138 textureData = General['SH Texture'] 1130 1139 if textureData['Order']: … … 1216 1225 phaseVary += pawleyVary 1217 1226 1218 return Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables 1227 return Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,maxSSwave 1219 1228 1220 1229 def cellFill(pfx,SGData,parmDict,sigDict): -
trunk/GSASIIstrMain.py
r1550 r1625 147 147 rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]}) 148 148 rbVary,rbDict = G2stIO.GetRigidBodyModels(rigidbodyDict,pFile=printFile) 149 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables = G2stIO.GetPhaseData(Phases,restraintDict,rbIds,pFile=printFile)149 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,maxSSwave = G2stIO.GetPhaseData(Phases,restraintDict,rbIds,pFile=printFile) 150 150 calcControls['atomIndx'] = atomIndx 151 151 calcControls['Natoms'] = Natoms 152 152 calcControls['FFtables'] = FFtables 153 153 calcControls['BLtables'] = BLtables 154 calcControls['maxSSwave'] = maxSSwave 154 155 hapVary,hapDict,controlDict = G2stIO.GetHistogramPhaseData(Phases,Histograms,pFile=printFile) 155 156 calcControls.update(controlDict) … … 243 244 rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]}) 244 245 rbVary,rbDict = G2stIO.GetRigidBodyModels(rigidbodyDict,pFile=printFile) 245 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables = G2stIO.GetPhaseData(Phases,restraintDict,rbIds,False,printFile)246 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,maxSSwave = G2stIO.GetPhaseData(Phases,restraintDict,rbIds,False,printFile) 246 247 for item in phaseVary: 247 248 if '::A0' in item: … … 269 270 calcControls['FFtables'] = FFtables 270 271 calcControls['BLtables'] = BLtables 272 calcControls['maxSSwave'] = maxSSwave 271 273 Histo = {histogram:Histograms[histogram],} 272 274 hapVary,hapDict,controlDict = G2stIO.GetHistogramPhaseData(Phases,Histo,Print=False) -
trunk/GSASIIstrMath.py
r1622 r1625 537 537 'Needs a doc string' 538 538 Natoms = calcControls['Natoms'][pfx] 539 maxSSwave = parmDict[pfx+'maxSSwave']539 maxSSwave = calcControls['maxSSwave'][pfx] 540 540 Nwave = {'F':maxSSwave['Sfrac'],'X':maxSSwave['Spos'],'Y':maxSSwave['Spos'],'Z':maxSSwave['Spos'], 541 541 'U':maxSSwave['Sadp'],'M':maxSSwave['Smag']} … … 544 544 USSdata = np.zeros((12,maxSSwave['Sadp'],Natoms)) 545 545 MSSdata = np.zeros((6,maxSSwave['Smag'],Natoms)) 546 keys = {'Fsin:':FSSdata[0],'Fcos:':FSSdata[1], 546 keys = {'Fsin:':FSSdata[0],'Fcos:':FSSdata[1],'Fzero:':FSSdata[0],'Fwid:':FSSdata[1], 547 'Tzero:':XSSdata[0],'Xslope:':XSSdata[1],'Yslope:':XSSdata[2],'Zslope:':XSSdata[3], 547 548 'Xsin:':XSSdata[0],'Ysin:':XSSdata[1],'Zsin:':XSSdata[2],'Xcos:':XSSdata[3],'Ycos:':XSSdata[4],'Zcos:':XSSdata[5], 548 549 'U11sin:':USSdata[0],'U22sin:':USSdata[1],'U33sin:':USSdata[2],'U12sin:':USSdata[3],'U13sin:':USSdata[4],'U23sin:':USSdata[5], -
trunk/imports/G2phase.py
r1606 r1625 510 510 print Sfrac[i] 511 511 for i,it in enumerate(Spos): 512 vals = [float(it[:9]),float(it[9:18]),float(it[18:27]),float(it[27:36]),float(it[36:45]),float(it[45:54])] 512 if waveType in ['ZigZag','Sawtooth'] and not i: 513 vals = [float(it[:9]),float(it[9:18]),float(it[18:27]),float(it[27:36])] 514 else: 515 vals = [float(it[:9]),float(it[9:18]),float(it[18:27]),float(it[27:36]),float(it[36:45]),float(it[45:54])] 513 516 Spos[i] = [vals,False] 514 517 for i,it in enumerate(Sadp):
Note: See TracChangeset
for help on using the changeset viewer.