Changeset 1683
 Timestamp:
 Feb 28, 2015 6:24:48 PM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIImath.py
r1674 r1683 209 209 def getNeighbors(atom,radius): 210 210 neighList = [] 211 Dx = IARS[1]np.array(atom[cx:cx+3])211 Dx = UAtomsnp.array(atom[cx:cx+3]) 212 212 dist = ma.masked_less(np.sqrt(np.sum(np.inner(Amat,Dx)**2,axis=0)),0.5) #gets rid of disorder "bonds" < 0.5A 213 sumR = IARS[2]+radius213 sumR = Radii+radius 214 214 return set(ma.nonzero(ma.masked_greater(distfactor*sumR,0.))[0]) #get indices of bonded atoms 215 215 … … 233 233 Indx = range(nAtom) 234 234 UAtoms = [] 235 SymOp = []236 235 Radii = [] 237 236 for atom in atomData: 238 237 UAtoms.append(np.array(atom[cx:cx+3])) 239 238 Radii.append(radii[atomTypes.index(atom[ct])]) 240 SymOp += [[1,0,unit],]241 239 UAtoms = np.array(UAtoms) 242 240 Radii = np.array(Radii) … … 244 242 UAtoms = np.concatenate((UAtoms,(np.inner(Op[0],UAtoms[:nAtom]).T+Op[1]))) 245 243 Radii = np.concatenate((Radii,Radii[:nAtom])) 246 SymOp += [[nOp,0,unit] for symop in SymOp]247 244 Indx += Indx[:nAtom] 248 245 for icen,cen in enumerate(SGData['SGCen'][1:]): 249 246 UAtoms = np.concatenate((UAtoms,(UAtoms+cen))) 250 247 Radii = np.concatenate((Radii,Radii)) 251 SymOp += [[symop[0],icen+1,unit] for symop in SymOp]252 248 Indx += Indx[:nAtom] 253 249 if SGData['SGInv']: 254 250 UAtoms = np.concatenate((UAtoms,UAtoms)) 255 251 Radii = np.concatenate((Radii,Radii)) 256 SymOp += [[symop[0],symop[1],unit] for symop in SymOp]257 252 Indx += Indx 258 253 UAtoms %= 1. … … 262 257 UAtoms = np.concatenate((UAtoms,UAtoms[:mAtoms]+unit)) 263 258 Radii = np.concatenate((Radii,Radii[:mAtoms])) 264 SymOp += [[symop[0],symop[1],unit] for symop in SymOp[:mAtoms]]265 259 Indx += Indx[:mAtoms] 266 260 UAtoms = np.array(UAtoms) 267 261 Radii = np.array(Radii) 268 IARS = [Indx,UAtoms,Radii,SymOp]269 262 newAtoms = [atomData[ind],] 270 263 atomData[ind] = None
Note: See TracChangeset
for help on using the changeset viewer.