- Timestamp:
- Feb 8, 2018 1:31:55 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIImath.py ¶
r3261 r3266 1630 1630 atxyz = G2spc.MoveToUnitCell(np.array(atom[cx:cx+3]))[0] 1631 1631 atuij = np.array(atom[cia+2:cia+8]) 1632 waveType = atom[-1]['SS1']['waveType']1633 1632 Sfrac = atom[-1]['SS1']['Sfrac'] 1634 1633 Spos = atom[-1]['SS1']['Spos'] … … 1651 1650 scof = [] 1652 1651 ccof = [] 1653 for i,sfrac in enumerate(Sfrac): 1652 waveType = Sfrac[0] 1653 for i,sfrac in enumerate(Sfrac[1:]): 1654 1654 if not i and 'Crenel' in waveType: 1655 1655 Fade[ind] += fracCrenel(tauT,sfrac[0][0],sfrac[0][1]) … … 1662 1662 scof = [] 1663 1663 ccof = [] 1664 for i,spos in enumerate(Spos): 1664 waveType = Spos[0] 1665 for i,spos in enumerate(Spos[1:]): 1665 1666 if waveType in ['ZigZag','Block'] and not i: 1666 1667 Tminmax = spos[0][:2] … … 1678 1679 scof = [] 1679 1680 ccof = [] 1680 for i,spos in enumerate(Smag): 1681 waveType = Smag[0] 1682 for i,spos in enumerate(Smag[1:]): 1681 1683 scof.append(spos[0][:3]) 1682 1684 ccof.append(spos[0][3:]) … … 1689 1691 scof = [] 1690 1692 ccof = [] 1691 for i,sadp in enumerate(Sadp): 1693 waveType = Sadp[0] 1694 for i,sadp in enumerate(Sadp[1:]): 1692 1695 scof.append(sadp[0][:6]) 1693 1696 ccof.append(sadp[0][6:]) -
TabularUnified trunk/GSASIIphsGUI.py ¶
r3258 r3266 1177 1177 generalData['4DmapData'] = mapDefault.copy() 1178 1178 generalData['4DmapData'].update({'MapType':'Fobs'}) 1179 atomData = data['Atoms'] 1180 for atom in atomData: 1181 if 'waveType' in atom[-1]['SS1']: 1182 waveType = atom[-1]['SS1']['waveType'] 1183 for parm in ['Sfrac','Spos','Sadp','Smag']: 1184 if len(atom[-1]['SS1'][parm]): 1185 wType = 'Fourier' 1186 if parm == 'Sfrac': 1187 if 'Crenel' in waveType: 1188 wType = 'Crenel' 1189 elif parm == 'Spos': 1190 if not 'Crenel' in waveType: 1191 wType = waveType 1192 atom[-1]['SS1'][parm] = [wType,]+atom[-1]['SS1'][parm] 1193 del atom[-1]['SS1']['waveType'] 1179 1194 if 'Modulated' not in generalData: 1180 1195 generalData['Modulated'] = False … … 2222 2237 2223 2238 # UpdateGeneral execution starts here 2239 #patches 2240 if 'Pawley dmax' not in data['General']: 2241 data['General']['Pawley dmax'] = 100.0 2242 if 'SGFixed' not in data['General']['SGData']: 2243 data['General']['SGData']['SGFixed'] = False 2244 if 'SGGray' not in data['General']['SGData']: 2245 data['General']['SGData']['SGGray'] = False 2246 #end patches 2224 2247 if General.GetSizer(): 2225 2248 General.GetSizer().Clear(True) … … 2239 2262 mainSizer.Add(ElemSizer()) 2240 2263 G2G.HorizontalLine(mainSizer,General) 2241 #patches2242 if 'Pawley dmax' not in generalData:2243 generalData['Pawley dmax'] = 100.02244 if 'SGFixed' not in generalData['SGData']:2245 generalData['SGData']['SGFixed'] = False2246 if 'SGGray' not in generalData['SGData']:2247 generalData['SGData']['SGGray'] = False2248 #end patches2249 2264 if generalData['Type'] == 'magnetic': 2250 2265 if not generalData['SGData']['SGFixed']: … … 4582 4597 cx,ct,cs,cia = generalData['AtomPtrs'] 4583 4598 typeNames = {'Sfrac':' Site fraction','Spos':' Position','Sadp':' Thermal motion','Smag':' Magnetic moment'} 4584 numVals = {'Sfrac':2,'Spos':6,'Sadp':12,'Smag':6,'ZigZag':5,'Block':5 }4599 numVals = {'Sfrac':2,'Spos':6,'Sadp':12,'Smag':6,'ZigZag':5,'Block':5,'Crenel':2,'SawTooth':3} 4585 4600 posNames = ['Xsin','Ysin','Zsin','Xcos','Ycos','Zcos','Tmin','Tmax','Xmax','Ymax','Zmax'] 4586 4601 adpNames = ['U11sin','U22sin','U33sin','U12sin','U13sin','U23sin', … … 4588 4603 magNames = ['MXsin','MYsin','MZsin','MXcos','MYcos','MZcos'] 4589 4604 fracNames = ['Fsin','Fcos','Fzero','Fwid'] 4590 waveTypes = ['Fourier','ZigZag','Block','Crenel/Fourier']4605 waveTypes = {'Sfrac':['Fourier','Crenel'],'Spos':['Fourier','ZigZag','Block','SawTooth'],'Sadp':['Fourier',],'Smag':['Fourier',]} 4591 4606 Labels = {'Spos':posNames,'Sfrac':fracNames,'Sadp':adpNames,'Smag':magNames} 4592 4607 Indx = {} … … 4632 4647 def AtomSizer(atom): 4633 4648 4634 def OnWaveType(event):4635 atom[-1]['SS1']['waveType'] = waveType.GetValue()4636 atom[-1]['SS1']['Spos'] = []4637 wx.CallAfter(RepaintAtomInfo,G2frame.waveData.GetScrollPos(wx.VERTICAL))4638 4639 4649 def OnShowWave(event): 4640 4650 Obj = event.GetEventObject() … … 4645 4655 atomSizer = wx.BoxSizer(wx.HORIZONTAL) 4646 4656 atomSizer.Add(wx.StaticText(waveData,label= 4647 ' Modulation data for atom: %s Site sym: %s WaveType: '%(atom[0],atom[cs].strip())),0,WACV) 4648 waveType = wx.ComboBox(waveData,value=atom[-1]['SS1']['waveType'],choices=waveTypes, 4649 style=wx.CB_READONLY|wx.CB_DROPDOWN) 4650 waveType.Bind(wx.EVT_COMBOBOX,OnWaveType) 4651 atomSizer.Add(waveType,0,WACV) 4657 ' Modulation data for atom: %s Site sym: %s'%(atom[0],atom[cs].strip())),0,WACV) 4652 4658 axchoice = ['x','y','z'] 4653 4659 if len(D4Map['rho']): … … 4660 4666 return atomSizer 4661 4667 4662 def WaveSizer(iatm,wave Type,waveBlk,Stype,typeName,Names):4668 def WaveSizer(iatm,wavedata,Stype,typeName,Names): 4663 4669 4670 def OnWaveType(event): 4671 Obj = event.GetEventObject() 4672 item = Indx[Obj.GetId()] 4673 if not len(atm[-1]['SS1'][item]): 4674 atm[-1]['SS1']['Spos'] = [0,[]] 4675 atm[-1]['SS1'][Stype][0] = waveType.GetValue() 4676 wx.CallAfter(RepaintAtomInfo,G2frame.waveData.GetScrollPos(wx.VERTICAL)) 4677 else: 4678 if len(waveTypes[Stype]) > 1: 4679 waveType.SetValue(atm[-1]['SS1'][Stype][0]) 4680 G2G.G2MessageBox(G2frame,'Warning: can only change wave type if no waves','Not changed') 4681 4664 4682 def OnAddWave(event): 4665 4683 Obj = event.GetEventObject() 4666 i atm,item = Indx[Obj.GetId()]4684 item = Indx[Obj.GetId()] 4667 4685 nt = numVals[Stype] 4668 if not len(at omData[iatm][-1]['SS1'][item]) and waveType in ['ZigZag','Block'] and Stype == 'Spos':4669 nt = numVals[waveTyp e]4670 at omData[iatm][-1]['SS1'][item].append([[0.0 for i in range(nt)],False])4686 if not len(atm[-1]['SS1'][item][1]) and waveTyp in ['ZigZag','Block','Crenel','SawTooth']: 4687 nt = numVals[waveTyp] 4688 atm[-1]['SS1'][item][1].append([[0.0 for i in range(nt)],False]) 4671 4689 wx.CallAfter(RepaintAtomInfo,G2frame.waveData.GetScrollPos(wx.VERTICAL)) 4672 4690 … … 4674 4692 event.Skip() 4675 4693 Obj = event.GetEventObject() 4676 i atm,item,iwave,ival = Indx[Obj.GetId()]4694 item,iwave,ival = Indx[Obj.GetId()] 4677 4695 try: 4678 4696 val = float(Obj.GetValue()) 4679 if waveTyp e in ['ZigZag','Block'] and Stype == 'Spos'and ival < 2 and not iwave:4697 if waveTyp in ['ZigZag','Block'] and ival < 2 and not iwave: 4680 4698 if ival == 1: #Tmax 4681 4699 val = min(1.0,max(0.0,val)) 4682 4700 elif ival == 0: #Tmin 4683 val = max(-1.,min(val,at omData[iatm][-1]['SS1'][item][iwave][0][1]))4701 val = max(-1.,min(val,atm[-1]['SS1'][item][1][iwave][1][1])) 4684 4702 except ValueError: 4685 val = at omData[iatm][-1]['SS1'][item][iwave][0][ival]4703 val = atm[-1]['SS1'][item][iwave][1][ival] 4686 4704 Obj.SetValue('%.5f'%val) 4687 at omData[iatm][-1]['SS1'][item][iwave][0][ival] = val4705 atm[-1]['SS1'][item][iwave][1][ival] = val 4688 4706 4689 4707 def OnRefWave(event): 4690 4708 Obj = event.GetEventObject() 4691 i atm,item,iwave = Indx[Obj.GetId()]4692 at omData[iatm][-1]['SS1'][item][iwave][1] = not atomData[iatm][-1]['SS1'][item][iwave][1]4709 item,iwave = Indx[Obj.GetId()] 4710 atm[-1]['SS1'][item][1][iwave][2] = not atm[-1]['SS1'][item][1][iwave][2] 4693 4711 4694 4712 def OnDelWave(event): 4695 4713 Obj = event.GetEventObject() 4696 i atm,item,iwave = Indx[Obj.GetId()]4697 del at omData[iatm][-1]['SS1'][item][iwave]4714 item,iwave = Indx[Obj.GetId()] 4715 del atm[-1]['SS1'][item][1][iwave] 4698 4716 wx.CallAfter(RepaintAtomInfo,G2frame.waveData.GetScrollPos(wx.VERTICAL)) 4699 4717 4718 waveTyp,waveBlk = 'Fourier',[] 4719 if len(wavedata): 4720 waveTyp = wavedata[0] 4721 waveBlk = wavedata[1:] 4700 4722 waveSizer = wx.BoxSizer(wx.VERTICAL) 4701 4723 waveHead = wx.BoxSizer(wx.HORIZONTAL) 4702 4724 waveHead.Add(wx.StaticText(waveData,label=typeName+' modulation parameters: '),0,WACV) 4703 waveAdd = wx.CheckBox(waveData,label='Add wave? ')4725 waveAdd = wx.CheckBox(waveData,label='Add wave? WaveType: ') 4704 4726 waveAdd.Bind(wx.EVT_CHECKBOX, OnAddWave) 4705 Indx[waveAdd.GetId()] = [iatm,Stype]4727 Indx[waveAdd.GetId()] = Stype 4706 4728 waveHead.Add(waveAdd,0,WACV) 4729 waveType = wx.ComboBox(waveData,value=waveTyp,choices=waveTypes[Stype], 4730 style=wx.CB_READONLY|wx.CB_DROPDOWN) 4731 Indx[waveType.GetId()] = Stype 4732 waveType.Bind(wx.EVT_COMBOBOX,OnWaveType) 4733 waveHead.Add(waveType,0,WACV) 4707 4734 waveSizer.Add(waveHead) 4708 4735 if len(waveBlk): … … 4710 4737 for iwave,wave in enumerate(waveBlk): 4711 4738 if not iwave: 4712 if waveTyp e in ['ZigZag','Block']:4739 if waveTyp in ['ZigZag','Block','SawTooth','Crenel']: 4713 4740 nx = 1 4714 CSI = G2spc.GetSSfxuinel(waveTyp e,1,xyz,SGData,SSGData)4741 CSI = G2spc.GetSSfxuinel(waveTyp,Stype,1,xyz,SGData,SSGData) 4715 4742 else: 4716 CSI = G2spc.GetSSfxuinel('Fourier', iwave+1-nx,xyz,SGData,SSGData)4743 CSI = G2spc.GetSSfxuinel('Fourier',Stype,iwave+1-nx,xyz,SGData,SSGData) 4717 4744 waveName = 'Fourier' 4718 4745 if Stype == 'Sfrac': 4719 if 'Crenel' in waveTyp eand not iwave:4746 if 'Crenel' in waveTyp and not iwave: 4720 4747 waveName = 'Crenel' 4721 4748 names = Names[2:] … … 4724 4751 Waves = wx.FlexGridSizer(0,4,5,5) 4725 4752 elif Stype == 'Spos': 4726 if waveTyp ein ['ZigZag','Block'] and not iwave:4753 if waveTyp in ['ZigZag','Block'] and not iwave: 4727 4754 names = Names[6:] 4728 4755 Waves = wx.FlexGridSizer(0,7,5,5) 4729 waveName = waveTyp e4756 waveName = waveTyp 4730 4757 else: 4731 4758 names = Names[:6] … … 4740 4767 waveVal.Bind(wx.EVT_TEXT_ENTER,OnWaveVal) 4741 4768 waveVal.Bind(wx.EVT_KILL_FOCUS,OnWaveVal) 4742 Indx[waveVal.GetId()] = [ iatm,Stype,iwave,ival]4769 Indx[waveVal.GetId()] = [Stype,iwave,ival] 4743 4770 else: 4744 4771 waveVal = wx.TextCtrl(waveData,value='%.5f'%(val),style=wx.TE_READONLY) … … 4750 4777 waveRef = wx.CheckBox(waveData,label='Refine?') 4751 4778 waveRef.SetValue(wave[1]) 4752 Indx[waveRef.GetId()] = [ iatm,Stype,iwave]4779 Indx[waveRef.GetId()] = [Stype,iwave] 4753 4780 waveRef.Bind(wx.EVT_CHECKBOX, OnRefWave) 4754 4781 Waves.Add(waveRef,0,WACV) … … 4757 4784 else: 4758 4785 waveDel = wx.CheckBox(waveData,label='Delete?') 4759 Indx[waveDel.GetId()] = [ iatm,Stype,iwave]4786 Indx[waveDel.GetId()] = [Stype,iwave] 4760 4787 waveDel.Bind(wx.EVT_CHECKBOX, OnDelWave) 4761 4788 Waves.Add(waveDel,0,WACV) … … 4774 4801 if generalData['Type'] != 'magnetic' and Stype == 'Smag': 4775 4802 break 4776 atomSizer.Add(WaveSizer(iatm,atm[-1]['SS1']['waveType'],atm[-1]['SS1'][Stype],Stype,typeNames[Stype],Labels[Stype])) 4803 4804 atomSizer.Add(WaveSizer(iatm,atm[-1]['SS1'][Stype],Stype,typeNames[Stype],Labels[Stype])) 4777 4805 return atomSizer 4778 4806 … … 6086 6114 wx.CallAfter(G2plt.PlotTexture,G2frame,data) 6087 6115 6116 def OnShoDet(event): 6117 Obj = event.GetEventObject() 6118 textureData['ShoDet'] = Obj.GetValue() 6119 wx.CallAfter(G2plt.PlotTexture,G2frame,data) 6120 6088 6121 def OnColorSel(event): 6089 6122 Obj = event.GetEventObject() … … 6263 6296 6264 6297 # UpdateTexture executable starts here 6265 if Texture.GetSizer(): Texture.GetSizer().Clear(True)6266 G2frame.GetStatusBar().SetStatusText('',1)6267 6298 generalData = data['General'] 6268 6299 SGData = generalData['SGData'] … … 6272 6303 textureData = generalData['SH Texture'] = {'Order':0,'Model':'cylindrical', 6273 6304 'Sample omega':[False,0.0],'Sample chi':[False,0.0],'Sample phi':[False,0.0], 6274 'SH Coeff':[False,{}],'SHShow':False,'PFhkl':[0,0,1], 6305 'SH Coeff':[False,{}],'SHShow':False,'PFhkl':[0,0,1],'ShoDet':False, 6275 6306 'PFxyz':[0,0,1.],'PlotType':'Pole figure'} 6276 6307 if 'SHShow' not in textureData: … … 6280 6311 if 'Penalty' not in textureData: 6281 6312 textureData['Penalty'] = [['',],0.1,False,1.0] 6313 if 'ShoDet' not in textureData: 6314 textureData['ShoDet'] = False 6282 6315 shModels = ['cylindrical','none','shear - 2/m','rolling - mmm'] 6283 6316 SamSym = dict(zip(shModels,['0','-1','2/m','mmm'])) 6317 keyList = G2frame.GetHistogramNames(['PWDR',]) 6318 UseList = data['Histograms'] 6319 HistsInPhase = [name for name in keyList if name in UseList] 6320 6321 textureData['det Angles'] = [] 6322 for hist in HistsInPhase: 6323 pId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,hist) #only use 1st histogram 6324 Sample = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,pId,'Sample Parameters')) 6325 Inst = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,pId,'Instrument Parameters'))[0] 6326 textureData['det Angles'] = [] 6327 if 'NT' in Inst['Type'][0]: 6328 Tth = Inst['2-theta'][1]/2. 6329 Gangls = [Sample['Phi'],Sample['Chi'],Sample['Omega'],Sample['Azimuth']] 6330 Sangls = [textureData['Sample omega'][1],textureData['Sample chi'][1],textureData['Sample phi'][1]] 6331 phi,gam,x,x = G2lat.SamAng(Tth,Gangls,Sangls,False) 6332 if phi > 90.: 6333 phi = 180.-phi 6334 gam += 180. 6335 gam %= 360. 6336 textureData['det Angles'].append([hist,phi,gam]) 6337 6338 G2frame.GetStatusBar().SetStatusText('',1) 6284 6339 if Texture.GetSizer(): 6285 6340 Texture.GetSizer().Clear(True) … … 6326 6381 projSel.Bind(wx.EVT_COMBOBOX,OnProjSel) 6327 6382 PTSizer.Add(projSel,0,WACV) 6328 PTSizer.Add((0,5),0) 6383 if textureData['PlotType'] == 'Pole figure' and len(textureData['det Angles']): 6384 shoDet = wx.CheckBox(Texture,-1,label=' Show detectors?') 6385 shoDet.SetValue(textureData['ShoDet']) 6386 shoDet.Bind(wx.EVT_CHECKBOX, OnShoDet) 6387 PTSizer.Add(shoDet,0,WACV) 6388 else: 6389 PTSizer.Add((0,5),0) 6329 6390 if textureData['PlotType'] in ['Pole figure','Axial pole distribution','3D pole distribution']: 6330 6391 PTSizer.Add(wx.StaticText(Texture,-1,' Pole figure HKL: '),0,WACV) -
TabularUnified trunk/GSASIIplot.py ¶
r3263 r3266 3974 3974 pf = G2lat.polfcal(ODFln,SamSym[textureData['Model']],np.array([r,]),np.array([p,])) 3975 3975 G2frame.G2plotNB.status.SetStatusText('phi =%9.3f, gam =%9.3f, MRD =%9.3f'%(r,p,pf),1) 3976 3976 3977 def OnPick(event): 3978 pick = event.artist 3979 Dettext = pick.get_gid() 3980 Page.SetToolTipString(Dettext) 3981 3982 #TODO: add histogram positions to polefigures 3977 3983 if '3D' in SHData['PlotType']: 3978 3984 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('Texture','3d') … … 3984 3990 else: 3985 3991 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 3992 Page.canvas.mpl_connect('pick_event', OnPick) 3986 3993 Page.Choice = None 3987 3994 G2frame.G2plotNB.status.SetStatusText('') … … 4070 4077 Z = np.reshape(Z,(npts,npts)) 4071 4078 try: 4072 CS = Plot.contour(Y,X,Z ,aspect='equal')4079 CS = Plot.contour(Y,X,Z) 4073 4080 Plot.clabel(CS,fontsize=9,inline=1) 4074 4081 except ValueError: … … 4077 4084 Img = Plot.imshow(Z.T,aspect='equal',cmap=acolor,extent=[-1,1,-1,1]) 4078 4085 Page.figure.colorbar(Img) 4086 if 'det Angles' in textureData and textureData['ShoDet']: 4087 Rdet = np.array([item[1] for item in textureData['det Angles']]) 4088 Pdet = np.array([item[2] for item in textureData['det Angles']]) 4089 if 'equal' in G2frame.Projection: 4090 Rdet = npsind(Rdet/2.)/sq2 4091 else: 4092 Rdet = nptand(Rdet/2.) 4093 Xdet = list(npcosd(Pdet)*Rdet) 4094 Ydet = list(npsind(Pdet)*Rdet) 4095 for i,[x,y] in enumerate(zip(Xdet,Ydet)): 4096 Plot.plot(x,-y,'k+',picker=5,gid=textureData['det Angles'][i][0]) 4079 4097 h,k,l = SHData['PFhkl'] 4080 4098 Plot.axis('off') … … 4141 4159 rhoSize = np.array(Map['rho'].shape) 4142 4160 atxyz = np.array(atom[cx:cx+3]) 4143 waveType = atom[-1]['SS1']['waveType']4144 4161 Spos = atom[-1]['SS1']['Spos'] 4145 4162 tau = np.linspace(0.,2.,101) … … 4148 4165 scof = [] 4149 4166 ccof = [] 4150 for i,spos in enumerate(Spos): 4167 waveType = Spos[0] 4168 for i,spos in enumerate(Spos[1:]): 4151 4169 if waveType in ['ZigZag','Block'] and not i: 4152 4170 Tminmax = spos[0][:2] -
TabularUnified trunk/GSASIIspc.py ¶
r3257 r3266 2147 2147 return SGOps[nA],SSGOps[nA],iC,SGData['SGCen'][nC],unit 2148 2148 2149 def GetSSfxuinel(waveType, nH,XYZ,SGData,SSGData,debug=False):2149 def GetSSfxuinel(waveType,Stype,nH,XYZ,SGData,SSGData,debug=False): 2150 2150 2151 2151 def orderParms(CSI): … … 2484 2484 tau = np.linspace(-1,1,49,True) 2485 2485 #make modulation arrays - one parameter at a time 2486 #site fractions2487 CSI['Sfrac'],dF,dFTP = DoFrac()2488 #positions2489 CSI['Spos'],dX,dXTP = DoXYZ()2490 #anisotropic thermal motion2491 CSI['Sadp'],dU,dUTP = DoUij()2492 CSI['Spos'][0] = orderParms(CSI['Spos'][0])2493 CSI['Sadp'][0] = orderParms(CSI['Sadp'][0])2486 if Stype == 'Sfrac': 2487 CSI['Sfrac'],dF,dFTP = DoFrac() 2488 elif Stype == 'Spos': 2489 CSI['Spos'],dX,dXTP = DoXYZ() 2490 CSI['Spos'][0] = orderParms(CSI['Spos'][0]) 2491 elif Stype == 'Sadp': 2492 CSI['Sadp'],dU,dUTP = DoUij() 2493 CSI['Sadp'][0] = orderParms(CSI['Sadp'][0]) 2494 2494 if debug: 2495 2495 return CSI,tau,[dF,dFTP],[dX,dXTP],[dU,dUTP] -
TabularUnified trunk/GSASIIstrIO.py ¶
r3255 r3266 987 987 if len(Waves): 988 988 pFile.write(' atom: %s, site sym: %s, type: %s wave type: %s:\n'% 989 (at[ct-1],at[cs],Stype,AtomSS['waveType'])) 990 for iw,wave in enumerate(Waves): 989 (at[ct-1],at[cs],Stype,Waves[0])) 990 else: 991 continue 992 for iw,wave in enumerate(Waves[1:]): 991 993 line = '' 992 if AtomSS['waveType'] in ['Block','ZigZag'] and Stype == 'Spos' and not iw:994 if Waves[0] in ['Block','ZigZag'] and Stype == 'Spos' and not iw: 993 995 for item in names[Stype][6:]: 994 996 line += '%8s '%(item) … … 1244 1246 if General.get('Modulated',False): 1245 1247 AtomSS = at[-1]['SS1'] 1246 waveType = AtomSS['waveType']1247 phaseDict[pfx+'waveType:'+str(i)] = waveType1248 1248 for Stype in ['Sfrac','Spos','Sadp','Smag']: 1249 1249 Waves = AtomSS[Stype] 1250 if len(Waves): 1251 waveType = Waves[0] 1252 else: 1253 continue 1254 phaseDict[pfx+Stype[1].upper()+'waveType:'+str(i)] = waveType 1250 1255 nx = 0 1251 for iw,wave in enumerate(Waves ):1256 for iw,wave in enumerate(Waves[1:]): 1252 1257 if not iw: 1253 1258 if waveType in ['ZigZag','Block']: 1254 1259 nx = 1 1255 CSI = G2spc.GetSSfxuinel(waveType, 1,at[cx:cx+3],SGData,SSGData)1260 CSI = G2spc.GetSSfxuinel(waveType,Stype,1,at[cx:cx+3],SGData,SSGData) 1256 1261 else: 1257 CSI = G2spc.GetSSfxuinel('Fourier', iw+1-nx,at[cx:cx+3],SGData,SSGData)1262 CSI = G2spc.GetSSfxuinel('Fourier',Stype,iw+1-nx,at[cx:cx+3],SGData,SSGData) 1258 1263 uId,uCoef = CSI[Stype] 1259 1264 stiw = str(i)+':'+str(iw) … … 1685 1690 for i,at in enumerate(Atoms): 1686 1691 AtomSS = at[-1]['SS1'] 1687 waveType = AtomSS['waveType']1688 1692 for Stype in ['Sfrac','Spos','Sadp','Smag']: 1689 1693 Waves = AtomSS[Stype] 1690 1694 if len(Waves): 1695 waveType = Waves[0] 1696 else: 1697 continue 1698 if len(Waves): 1691 1699 pFile.write(' atom: %s, site sym: %s, type: %s wave type: %s:\n'% 1692 1700 (at[ct-1],at[cs],Stype,waveType)) 1693 for iw,wave in enumerate(Waves ):1701 for iw,wave in enumerate(Waves[1:]): 1694 1702 stiw = ':'+str(i)+':'+str(iw) 1695 1703 namstr = ' names :' … … 2022 2030 if General.get('Modulated',False): 2023 2031 AtomSS = at[-1]['SS1'] 2024 waveType = AtomSS['waveType']2025 2032 for Stype in ['Sfrac','Spos','Sadp','Smag']: 2026 2033 Waves = AtomSS[Stype] 2027 for iw,wave in enumerate(Waves): 2034 if len(Waves): 2035 waveType = Waves[0] 2036 else: 2037 continue 2038 for iw,wave in enumerate(Waves[1:]): 2028 2039 stiw = str(i)+':'+str(iw) 2029 2040 if Stype == 'Spos': … … 2047 2058 'MXcos:'+stiw,'MYcos:'+stiw,'MZcos:'+stiw] 2048 2059 for iname,name in enumerate(names): 2049 AtomSS[Stype][iw ][0][iname] = parmDict[pfx+name]2060 AtomSS[Stype][iw+1][0][iname] = parmDict[pfx+name] 2050 2061 if pfx+name in sigDict: 2051 2062 wavesSig[name] = sigDict[pfx+name] -
TabularUnified trunk/GSASIIstrMath.py ¶
r3254 r3266 634 634 'MXsin:':MSSdata[0],'MYsin:':MSSdata[1],'MZsin:':MSSdata[2],'MXcos:':MSSdata[3],'MYcos:':MSSdata[4],'MZcos:':MSSdata[5]} 635 635 for iatm in range(Natoms): 636 waveTypes.append(parmDict[pfx+'waveType:'+str(iatm)]) 636 for kind in ['F','P','A','M']: 637 wavetype = [] 638 wavetype += [parmDict.get(pfx+kind+'waveType:'+str(iatm),''),] 639 waveTypes.append(wavetype) 637 640 for key in keys: 638 641 for m in range(Nwave[key[0]]): -
TabularUnified trunk/imports/G2phase.py ¶
r3252 r3266 345 345 if shNcof: 346 346 shCoef = {} 347 nRec = [i+1 for i in range((shNcof-1)/ 6+1)]347 nRec = [i+1 for i in range((shNcof-1)//6+1)] 348 348 for irec in nRec: 349 349 ODkey = keyList[0][:6]+'OD'+'%3dA'%(irec) … … 584 584 Atom.append([]) 585 585 Atom.append([]) 586 Atom.append({'SS1':{' waveType':waveType,'Sfrac':Sfrac,'Spos':Spos,'Sadp':Sadp,'Smag':Smag}}) #SS2 is for (3+2), etc.586 Atom.append({'SS1':{'Sfrac':[waveType,]+Sfrac,'Spos':[waveType,]+Spos,'Sadp':['Fourier',]+Sadp,'Smag':['Fourier',]+Smag}}) #SS2 is for (3+2), etc. 587 587 Atoms.append(Atom) 588 588 file2.close() -
TabularUnified trunk/imports/G2phase_CIF.py ¶
r3261 r3266 496 496 497 497 if nim >= 0: 498 Sfrac = [ [sfrac,False] for sfrac in Sfrac[:nim]]498 Sfrac = [waveType,]+[[sfrac,False] for sfrac in Sfrac[:nim]] 499 499 else: 500 500 Sfrac = [] … … 512 512 Spos[im-1][ix+3] = cif.get_number_with_esd(val)[0] 513 513 if nim >= 0: 514 Spos = [ [spos,False] for spos in Spos[:nim]]514 Spos = [waveType,]+[[spos,False] for spos in Spos[:nim]] 515 515 else: 516 516 Spos = [] … … 519 519 for i,item in enumerate(UijFdict['_atom_site_u_fourier_atom_site_label']): 520 520 if item == atomlist[0]: 521 waveType = 'Fourier'522 521 ix = ['U11','U22','U33','U12','U13','U23'].index(UijFdict['_atom_site_u_fourier_tens_elem'][i]) 523 522 im = int(UijFdict['_atom_site_u_fourier_wave_vector_seq_id'][i]) … … 529 528 Sadp[im-1][ix+6] = cif.get_number_with_esd(val)[0] 530 529 if nim >= 0: 531 Sadp = [ [sadp,False] for sadp in Sadp[:nim]]530 Sadp = ['Fourier',]+[[sadp,False] for sadp in Sadp[:nim]] 532 531 else: 533 532 Sadp = [] … … 536 535 for i,item in enumerate(MagFdict[Mnames[0]]): 537 536 if item == atomlist[0]: 538 waveType = 'Fourier'539 537 ix = ['x','y','z'].index(MagFdict[Mnames[1]][i]) 540 538 im = int(MagFdict[Mnames[2]][i]) … … 545 543 val = MagFdict[Mnames[4]][i] 546 544 Smag[im-1][ix+3] = cif.get_number_with_esd(val)[0] 547 548 Smag =[[smag,False] for smag in Smag[:nim]]549 550 551 SSdict = {'SS1':{' waveType':waveType,'Sfrac':Sfrac,'Spos':Spos,'Sadp':Sadp,'Smag':Smag}}545 if nim >= 0: 546 Smag = ['Fourier',]+[[smag,False] for smag in Smag[:nim]] 547 else: 548 Smag = [] 549 SSdict = {'SS1':{'Sfrac':Sfrac,'Spos':Spos,'Sadp':Sadp,'Smag':Smag}} 552 550 if magnetic and atomlist[0] in magatomlabels: 553 551 matomlist.append(SSdict) -
TabularUnified trunk/imports/G2pwd_fxye.py ¶
r3146 r3266 394 394 elif 'Omega' in S.split('=')[0] or 'Theta' in S.split('=')[0]: #HIPD weirdness 395 395 try: 396 self.Sample['Omega'] = 90.-float(S.split('=')[1])396 self.Sample['Omega'] = float(S.split('=')[1]) 397 397 except: 398 398 pass 399 399 elif 'Chi' in S.split('=')[0]: 400 400 try: 401 self.Sample['Chi'] = -float(S.split('=')[1])401 self.Sample['Chi'] = float(S.split('=')[1]) 402 402 except: 403 403 pass
Note: See TracChangeset
for help on using the changeset viewer.