Changeset 522 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Mar 20, 2012 1:38:12 PM (10 years ago)
Author:
vondreele
Message:

begin map search routines - GUI so far
make map move outside unit cell when view point is moved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r521 r522  
    22672267    thermal motion ellipsoids and polyhedra
    22682268    '''
     2269    ForthirdPI = 4.0*math.pi/3.0
    22692270    generalData = data['General']
    22702271    cell = generalData['Cell'][1:7]
     2272    Vol = generalData['Cell'][7:8][0]
    22712273    Amat,Bmat = G2lat.cell2AB(cell)         #Amat - crystal to cartesian, Bmat - inverse
    22722274    A4mat = np.concatenate((np.concatenate((Amat,[[0],[0],[0]]),axis=1),[[0,0,0,1],]),axis=0)
     
    27262728    def Draw():
    27272729        if 'Map' in generalData:
     2730            VP = np.array(drawingData['viewPoint'][0])-np.array([.5,.5,.5])
    27282731            mapData = generalData['Map']
    27292732            contLevel = drawingData['contourLevel']*mapData['rhoMax']
     
    27322735            else:
    27332736                rho = ma.array(mapData['rho'],mask=(mapData['rho']<contLevel))
     2737            steps = 1./np.array(rho.shape)
     2738            incre = np.where(VP>0,VP%steps,VP%steps-steps)
     2739            Vsteps = -np.array(VP/steps,dtype='i')
     2740            rho = np.roll(np.roll(np.roll(rho,Vsteps[0],axis=0),Vsteps[1],axis=1),Vsteps[2],axis=2)
    27342741            indx = np.array(ma.nonzero(rho)).T
    2735             steps = 1./np.array(rho.shape)
    2736             rhoXYZ = indx*steps
    2737             radius = drawingData['mapSize']**2
     2742            rhoXYZ = indx*steps+VP-incre
     2743            Nc = len(rhoXYZ)
     2744            rcube = 2000.*Vol/(ForthirdPI*Nc)
     2745            rmax = math.exp(math.log(rcube)/3.)**2
     2746            radius = min(drawingData['mapSize']**2,rmax)
    27382747            view = np.array(drawingData['viewPoint'][0])
    27392748            Rok = np.sum(np.inner(Amat,rhoXYZ-view).T**2,axis=1)>radius
Note: See TracChangeset for help on using the changeset viewer.