Changeset 839
- Timestamp:
- Jan 23, 2013 12:02:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r837 r839 2585 2585 thermal motion ellipsoids and polyhedra 2586 2586 ''' 2587 2587 2588 ForthirdPI = 4.0*math.pi/3.0 2588 2589 generalData = data['General'] … … 2633 2634 ctrlDown = False 2634 2635 2636 def FindPeaksBonds(XYZ): 2637 Bonds = [[] for x in XYZ] 2638 for i,xyz in enumerate(XYZ): 2639 Dx = XYZ-xyz 2640 dist = np.sqrt(np.sum(np.inner(Dx,Amat)**2,axis=1)) 2641 IndB = ma.nonzero(ma.masked_greater(dist,2.1)) 2642 for j in IndB[0]: 2643 Bonds[i].append(Dx[j]/2.) 2644 Bonds[j].append(-Dx[j]/2.) 2645 return Bonds 2646 2635 2647 def OnKeyBox(event): 2636 2648 import Image … … 3327 3339 RenderMap(rho,rhoXYZ,indx,Rok) 3328 3340 if len(mapPeaks): 3341 XYZ = mapPeaks.T[1:4].T 3342 mapBonds = FindPeaksBonds(XYZ) 3329 3343 for ind,[mag,x,y,z,d] in enumerate(mapPeaks): 3330 3344 if ind in Ind and pageName == 'Map peaks': … … 3332 3346 else: 3333 3347 RenderMapPeak(x,y,z,Wt,mag/peakMax) 3348 RenderLines(x,y,z,mapBonds[ind],Wt) 3334 3349 if Backbones: 3335 3350 for chain in Backbones: … … 3386 3401 ''' 3387 3402 3388 def FindBonds(XYZ): #uses numpy & masks - very fast even for proteins! 3389 import numpy.ma as ma 3403 def FindBonds(XYZ): 3390 3404 rbTypes = rbData['rbTypes'] 3391 3405 Radii = []
Note: See TracChangeset
for help on using the changeset viewer.