# Changeset 3097

Ignore:
Timestamp:
Sep 24, 2017 8:02:10 PM (5 years ago)
Message:

fix origin shift transformation & vec,matrix, vec transformations; now works

Location:
trunk
Files:
4 edited

Unmodified
Removed
• ## trunk/GSASIIlattice.py

 r3092 return UijtoU6(Uij) def TransformPhase(oldPhase,newPhase,Trans,Vec,ifMag): def TransformPhase(oldPhase,newPhase,Trans,Uvec,Vvec,ifMag): '''Transform atoms from oldPhase to newPhase by Trans & Vec newPhase['Draw Atoms'] = [] for atom in newAtoms: atom[cx:cx+3] = TransformXYZ(atom[cx:cx+3],invTrans.T,Vec)%1. atom[cx:cx+3] = TransformXYZ(atom[cx:cx+3]-Uvec,invTrans,Vvec)%1. if atom[cia] == 'A': atom[cia+2:cia+8] = TransformU6(atom[cia+2:cia+8],invTrans) def FillUnitCell(Phase): Atoms = Phase['Atoms'] Atoms = copy.deepcopy(Phase['Atoms']) atomData = [] atCodes = []
• ## trunk/GSASIImath.py

 r3095 else: if atom[3].strip() == 'C': tgts = [tgt for tgt in tgts if not (cartAtoms[tgt][3].strip() == 'N' and int(cartAtoms[tgt][0]) == ires+1)] tgts = [tgt for tgt in tgts if not (cartAtoms[tgt][3].strip() == 'N' and int(cartAtoms[tgt][0])  in [ires-1,ires+1])] elif atom[3].strip() == 'N': tgts = [tgt for tgt in tgts if not (cartAtoms[tgt][3].strip() == 'C' and int(cartAtoms[tgt][0]) == ires-1)] tgts = [tgt for tgt in tgts if not (cartAtoms[tgt][3].strip() == 'C' and int(cartAtoms[tgt][0])  in [ires-1,ires+1])] for tgt in tgts: dsqt = np.sqrt(np.sum((XYZ[ia]-XYZ[tgt])**2)) mtrx[4] += IntAct[j]['NO'] mtrx /= summ #            print i+1,mtrx*summ if old: mtrx -= avg_old
• ## trunk/GSASIIphsGUI.py

 r3095 else: if self.Common == G2gd.commonNames[-1]:      #change setting self.Vec = G2spc.spg2origins[self.oldSpGrp] self.Vvec = G2spc.spg2origins[self.oldSpGrp] self.newSpGrp = self.oldSpGrp else: cx,ct,cs,cia = generalData['AtomPtrs'] SGData = generalData['SGData'] if SGData['SpGrp'] in G2spc.spg2origins: T = G2spc.spg2origins[SGData['SpGrp']] Atoms = data['Atoms'] for atom in Atoms: for i in range(3): atom[cx+i] -= Uvec[i] atom[cs:cs+2] = G2spc.SytSym(atom[cx:cx+3],SGData)[:2] for i in [0,1,2]: atom[cx+i] += T[i] data['Drawing'] = [] else: phaseName = newPhase['General']['Name'] newPhase,atCodes = G2lat.TransformPhase(data,newPhase,Trans,Vvec,ifMag) newPhase,atCodes = G2lat.TransformPhase(data,newPhase,Trans,Uvec,Vvec,ifMag) detTrans = np.abs(nl.det(Trans))
• ## trunk/GSASIIspc.py

 r2875 'F m -3 m','F m -3 c','F d -3 m','F d -3 c', 'I m -3 m','I a -3 d',]                                       #195-230 spg2origins = {} ''' A dictionary of all spacegroups that have 2nd settings; the value is the 1st --> 2nd setting transformation vector as X(2nd) = X(1st)-V, nonstandard ones are included. ''' spg2origins = { 'P n n n':[-.25,-.25,-.25], 'P b a n':[-.25,-.25,0],'P n c b':[0,-.25,-.25],'P c n a':[-.25,0,-.25], 'P m m n':[-.25,-.25,0],'P n m m':[0,-.25,-.25],'P m n m':[-.25,0,-.25], 'C c c a':[0,-.25,-.25],'C c c b':[-.25,0,-.25],'A b a a':[-.25,0,-.25], 'A c a a':[-.25,-.25,0],'B b c b':[-.25,-.25,0],'B b a b':[0,-.25,-.25], 'F d d d':[-.125,-.125,-.125], 'P 4/n':[-.25,-.25,0],'P 42/n':[-.25,-.25,-.25],'I 41/a':[0,-.25,-.125], 'P 4/n b m':[-.25,-.25,0],'P 4/n n c':[-.25,-.25,-.25],'P 4/n m m':[-.25,-.25,0],'P 4/n c c':[-.25,-.25,0], 'P 42/n b c':[-.25,-.25,-.25],'P 42/n n m':[-.25,.25,-.25],'P 42/n m c':[-.25,.25,-.25],'P 42/n c m':[-.25,.25,-.25], 'I 41/a m d':[0,.25,-.125],'I 41/a c d':[0,.25,-.125], 'p n -3':[-.25,-.25,-.25],'F d -3':[-.125,-.125,-.125],'P n -3 n':[-.25,-.25,-.25], 'P n -3 m':[-.25,-.25,-.25],'F d -3 m':[-.125,-.125,-.125],'F d -3 c':[-.375,-.375,-.375], 'p n 3':[-.25,-.25,-.25],'F d 3':[-.125,-.125,-.125],'P n 3 n':[-.25,-.25,-.25], 'P n 3 m':[-.25,-.25,-.25],'F d 3 m':[-.125,-.125,-.125],'F d - c':[-.375,-.375,-.375]} spglist = {} '''A dictionary of space groups as ordered and named in the pre-2002 International 'F -4 3 c','F m -3 m','F m 3 m','F m -3 c','F d -3 m','F d -3 c',), } spg2origins = {} ''' A dictionary of all space groups with two alternative origin settings. each entry is symbol: atom transpation vector for setting #1 --> setting #2 ''' spg2origins = {"P n n n":[-.25,-.25,-.25],"P b a n":[-.25,-.25 ,0], "P n c b":[0,-.25,-.25],"P c n a":[-.25,0,-.25],"P m m n":[-.25,-.25 ,0], "P n m m":[0,-.25,-.25],"P m n m":[-.25,0,-.25],"C c c a":[0,-.25,-.25], "C c c b":[-.25,0,-.25],"A b a a":[-.25,0,-.25],"A c a a":[-.25,-.25,0], "B b c b":[-.25,-.25,0],"B b a b":[0,-.25,-.25],"F d d d":[.125,.125,.125], "P 4/n":[.25,-.2, 0],"P 42/n":[.25,.25,.25],"I 41/a":[0,.25,.125], "P 4/n b m":[.25,.25,0],"P 4/n n c":[.25,.25,.25],"P 4/n m m":[.25,-.25,0], "P 4/n c c":[.25,-.25,0],"P 42/n b c":[.25,-.25,.25],"P 42/n n m":[.25,-.25,.25], "P 42/n m c":[.25,-.25,.25],"P 42/n c m":[.25,-.25,.25], "I 41/a m d":[0,-.25,.125],"I 41/a c d":[0,-.25,.125], "P n 3":[.25,.25,.25],"F d 3":[.125,.125,.125],"P n 3 n":[.25,.25,.25], "P n 3 m":[.25,.25,.25],"F d 3 m":[.125,.125,.125],"F d 3 c":[.375,.375,.375], "P n -3":[.25,.25,.25],"F d -3":[.125,.125,.125],"P n -3 n":[.25,.25,.25], "P n -3 m":[.25,.25,.25],"F d -3 m":[.125,.125,.125],"F d -3 c":[.375,.375,.375]} ssdict = {}
Note: See TracChangeset for help on using the changeset viewer.