Changeset 2184
- Timestamp:
- Mar 25, 2016 10:36:47 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimgGUI.py
r2183 r2184 362 362 363 363 # Sizers 364 364 Indx = {} 365 365 def ComboSizer(): 366 366 … … 525 525 'phi':['Tilt rotation','%.2f',data['rotation']],'dep':['Penetration','%.2f',data['DetDepth']], 526 526 'wave':['Wavelength','%.6f',data['wavelength']]} 527 Indx = {}527 # Indx = {} 528 528 for name in Names: 529 529 calSel = wx.CheckBox(parent=G2frame.dataDisplay,label=Parms[name][0]) -
trunk/GSASIIphsGUI.py
r2183 r2184 1205 1205 1206 1206 mainSizer.Add(FlipSizer()) 1207 if generalData['Type'] in ['nuclear','macromolecular' ]:1207 if generalData['Type'] in ['nuclear','macromolecular','faulted',]: 1208 1208 G2G.HorizontalLine(mainSizer,General) 1209 1209 mainSizer.Add(MCSASizer()) … … 1249 1249 if Atoms.GetColLabelValue(c) == 'refine': 1250 1250 Type = generalData['Type'] 1251 if Type in ['nuclear','macromolecular','modulated' ]:1251 if Type in ['nuclear','macromolecular','modulated','faulted',]: 1252 1252 choice = ['F - site fraction','X - coordinates','U - thermal parameters'] 1253 1253 elif Type in ['magnetic',]: … … 1669 1669 if generalData['Type'] == 'macromolecular': 1670 1670 atomData.append([0,Name,'',Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.10,0,0,0,0,0,0,atId]) 1671 elif generalData['Type'] == 'nuclear':1671 elif generalData['Type'] in ['nuclear','faulted',]: 1672 1672 atomData.append([Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.01,0,0,0,0,0,0,atId]) 1673 elif generalData['Type'] in ['modulated','magnetic' ]:1673 elif generalData['Type'] in ['modulated','magnetic',]: 1674 1674 atomData.append([Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.01,0,0,0,0,0,0,atId,[],[], 1675 1675 {'SS1':{'waveType':'Fourier','Sfrac':[],'Spos':[],'Sadp':[],'Smag':[]}}]) … … 1853 1853 generalData = data['General'] 1854 1854 SGData = generalData['SGData'] 1855 if generalData['Type'] in ['nuclear','modulated', ]:1855 if generalData['Type'] in ['nuclear','modulated','faulted',]: 1856 1856 if oldatom: 1857 1857 opr = oldatom[5] … … 1888 1888 if generalData['Type'] == 'macromolecular': 1889 1889 atomData.insert(indx,[0,Name,'',Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.10,0,0,0,0,0,0,atId]) 1890 elif generalData['Type'] == 'nuclear':1890 elif generalData['Type'] in ['nuclear','faulted',]: 1891 1891 atomData.insert(indx,[Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.01,0,0,0,0,0,0,atId]) 1892 1892 elif generalData['Type'] in ['modulated','magnetic']: … … 2411 2411 plotDefaults = {'oldxy':[0.,0.],'Quaternion':[0.,0.,0.,1.],'cameraPos':30.,'viewDir':[0,0,1], 2412 2412 'viewPoint':[[0.,0.,0.],[]],} 2413 Indx = {} 2413 2414 2414 2415 def OnLaue(event): … … 2526 2527 widths = Layers['Width'][0] 2527 2528 flags = Layers['Width'][1] 2528 Indx = {}2529 2529 widthSizer = wx.BoxSizer(wx.HORIZONTAL) 2530 2530 for i in range(2): … … 2664 2664 Names = [layer['Name'] for layer in Layers['Layers']] 2665 2665 transArray = Layers['Transitions'] 2666 Indx = {}2667 2666 layerData.transGrids = [] 2668 2667 if not Names or not transArray: … … 3272 3271 drawingData['showRigidBodies'] = True 3273 3272 cx,ct,cs,ci = [0,0,0,0] 3274 if generalData['Type'] in ['nuclear','modulated' ]:3273 if generalData['Type'] in ['nuclear','modulated','faulted',]: 3275 3274 cx,ct,cs,ci = [2,1,6,17] #x, type, style & index 3276 3275 elif generalData['Type'] == 'macromolecular': … … 4315 4314 SetupDrawingData() 4316 4315 drawingData = data['Drawing'] 4317 if generalData['Type'] == 'nuclear':4316 if generalData['Type'] in ['nuclear','faulted',]: 4318 4317 pickChoice = ['Atoms','Bonds','Torsions','Planes'] 4319 4318 elif generalData['Type'] == 'macromolecular': -
trunk/GSASIIpwd.py
r2183 r2184 1936 1936 def CalcStackingSADP(Layers): 1937 1937 1938 def getXY_HK(hk,Layers): 1939 XY_HK = {} 1940 for layer in Layers['Layers']: 1941 if not layer['SameAs']: #a real layer 1942 XY_HK[layer['Name']] = np.inner(hk,np.array([atom[2:4] for atom in layer['Atoms']]))*2.*np.pi 1943 return XY_HK 1938 atTypes = Layers['AtInfo'].keys() 1939 Adat = [] 1940 for atType in atTypes: 1941 if atType == 'H': 1942 blen = -.3741 1943 else: 1944 blen = Layers['AtInfo'][atType]['Isotopes']['Nat. Abund.']['SL'][0] 1945 Adat.append([[Adat['fa'][i],Adat['fb'][i]] for i in range(4)]+[Adat['fc'],]) 1946 Adat = np.array(Adat).flatten() 1947 AtomXOU = [] 1948 AtomTp = [] 1949 AtomNL = [] 1950 LayerSymm = [] 1951 LayerNum = [] 1952 layerNames = [] 1953 Natm = 1 1954 Nuniq = 0 1955 for layer in Layers['Layers']: 1956 layerNames.append(layer['Name']) 1957 for il,layer in enumerate(Layers['Layers']): 1958 if layer['SameAs']: 1959 LayerNum.append(layerNames.index(layer['SameAs'])+1) 1960 continue 1961 else: 1962 LayerNum.append(il) 1963 Nuniq += 1 1964 if '-1' in layer['Symm']: 1965 LayerSymm.append(1) 1966 else: 1967 LayerSymm.append(0) 1968 AtomNL.append(Natm) 1969 for ia,atom in enumerate(layer['Atoms']): 1970 [name,atype,x,y,z,frac,Uiso] = atom 1971 Natm += 1 1972 AtomTp.append(atype) 1973 AtomXOU.append([x,y,z,frac,Uiso*78.9568]) 1974 TransX = [] 1975 TransP = [] 1976 for Ytrans in Layers['Transitions']: 1977 TransP.append([trans[0] for trans in Ytrans]) #get just the numbers 1978 TransX.append([trans[1:4] for trans in Ytrans]) #get just the numbers 1979 TransP = np.array(Trans,dtype='float') 1980 TransX = np.array(Trans,dtype='float') 1981 Nlayers = np.sqrt(TransP.shape[0]) 1982 Cell = Layers['Cell'][1:4]+Layers['Cell'][6:7] 1944 1983 1945 def getDXY_HK(hk,Trans,detune): 1946 N = Trans.shape[0] 1947 DXY_HK = np.zeros((N,N),dtype='cfloat') 1948 Lphi = np.zeros((N,N),dtype='cfloat') 1949 for iY in range(N): 1950 for iX in range(N): 1951 if [str(iY+1),str(iX+1)] in Layers['allowedTrans']: 1952 dot = 2.*np.pi*np.inner(hk,Trans[iY,iX,1:3]) 1953 Lphi[iY,iX] = complex(np.cos(dot),np.sin(dot)) 1954 DXY_HK[iY][iX] = detune*Trans[iY,iX,0]*Lphi[iY,iX] 1955 return DXY_HK,Lphi 1956 1957 1958 1959 sadpSize = 256 1960 G,g = G2lat.cell2Gmat(Layers['Cell'][1:7]) #recip/real met. tensors 1961 A = G2lat.Gmat2A(G) 1984 laueId = ['-1','2/m(ab)','2/m(c)','mmm','-3','-3m','4/m','4/mmm', 1985 '6/m','6/mmm','axial','unknown'].index(Layers['Laue']) 1986 planeId = ['h0l','0kl','hhl','h-hl'],index(Layers['Sadp']['Plane'])+1 1962 1987 lmax = float(Layers['Sadp']['Lmax']) 1963 Smax = G2lat.calc_rDsq([0.,0.,lmax],A) 1964 plane = Layers['Sadp']['Plane'] 1965 if plane == 'h0l': 1966 hkmax = int(lmax*np.sqrt(A[2]/A[0])) 1967 elif plane == '0kl': 1968 hkmax = int(lmax*np.sqrt(A[2]/A[1])) 1969 elif plane == 'hhl': 1970 hkmax = int(lmax*np.sqrt(A[2]/(A[0]+A[1]+A[5]))) 1971 elif plane == 'h-hl': 1972 hkmax = int(lmax*np.sqrt(A[2]/(A[0]+A[1]-A[5]))) 1973 dl = 2.*lmax/sadpSize 1974 Trans = [] 1975 for Ytrans in Layers['Transitions']: 1976 Trans.append([trans[:4] for trans in Ytrans]) #get just the numbers 1977 Trans = np.array(Trans,dtype='float') 1978 N = np.sqrt(Trans.shape[0]) 1979 lmax -= 0.5*dl #shift lmax to avoid l=0 1980 lmin = -lmax 1981 sadpBlock = sadpSize 1982 if Layers['Laue'] not in ['-1','2/m(c)','-3','-3m','axial']: 1983 lmin = -0.5*dl 1984 sadpBlock /= 2 1985 #start 1986 cnt = 0 1987 Names = [layer['Name'] for layer in Layers['Layers']] 1988 Nlayers = len(Names) 1989 detune = 1.0-0.001 1990 for i in range(hkmax+1): 1991 if plane == 'h0l': 1992 hk = np.array([i,0]) 1993 elif plane == '0kl': 1994 hk = np.array([0,i]) 1995 elif lane == 'hhl': 1996 hk = np.array([i,i]) 1997 else: 1998 hk = np.array([i,-i]) 1999 print ' h = %d k = %d'%(hk[0],hk[1]) 2000 XY_HK = getXY_HK(hk,Layers) #good 2001 DXY_HK,Lphi = getDXY_HK(hk,Trans,detune) #good 2002 1988 controls = [laueId,planeId,lmax,Nuniq,] 2003 1989 2004 2005 1990 Sadp = np.array(256**2) 1991 Sadp = pygetsadp(controls,len(AtTypes),AtTypes,Adat,Cell,Natm,AtomTp,AtomXOU,Nlayers,TransP,TransX,stackseq,Sadp) 2006 1992 2007 1993 -
trunk/GSASIIstrIO.py
r2156 r2184 889 889 line = ' res no residue chain'+line 890 890 print >>pFile,line 891 if General['Type'] in ['nuclear','modulated','magnetic' ]:891 if General['Type'] in ['nuclear','modulated','magnetic','faulted',]: 892 892 print >>pFile,135*'-' 893 893 for i,at in enumerate(Atoms):
Note: See TracChangeset
for help on using the changeset viewer.