Changeset 839


Ignore:
Timestamp:
Jan 23, 2013 12:02:59 PM (9 years ago)
Author:
vondreele
Message:

draw bonds between map peaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r837 r839  
    25852585    thermal motion ellipsoids and polyhedra
    25862586    '''
     2587
    25872588    ForthirdPI = 4.0*math.pi/3.0
    25882589    generalData = data['General']
     
    26332634    ctrlDown = False
    26342635   
     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
    26352647    def OnKeyBox(event):
    26362648        import Image
     
    33273339            RenderMap(rho,rhoXYZ,indx,Rok)
    33283340        if len(mapPeaks):
     3341            XYZ = mapPeaks.T[1:4].T
     3342            mapBonds = FindPeaksBonds(XYZ)
    33293343            for ind,[mag,x,y,z,d] in enumerate(mapPeaks):
    33303344                if ind in Ind and pageName == 'Map peaks':
     
    33323346                else:
    33333347                    RenderMapPeak(x,y,z,Wt,mag/peakMax)
     3348                RenderLines(x,y,z,mapBonds[ind],Wt)
    33343349        if Backbones:
    33353350            for chain in Backbones:
     
    33863401    '''
    33873402
    3388     def FindBonds(XYZ):                    #uses numpy & masks - very fast even for proteins!
    3389         import numpy.ma as ma
     3403    def FindBonds(XYZ):
    33903404        rbTypes = rbData['rbTypes']
    33913405        Radii = []
Note: See TracChangeset for help on using the changeset viewer.