Changeset 523 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Mar 29, 2012 3:52:03 PM (10 years ago)
Author:
toby
Message:

fix plotting with as-inititalized values (oldxy & Fourier map); fix CIF import; fix command-line load; fix early Destroy in SumDialog?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r522 r523  
    25022502        Tx,Ty,Tz = drawingData['viewPoint'][0]
    25032503        anglex,angley,anglez,oldxy = drawingData['Rotation']
     2504        if not len(oldxy): oldxy = list(newxy)
    25042505        Rx = G2lat.rotdMat(anglex,0)
    25052506        Ry = G2lat.rotdMat(angley,1)
     
    25172518        Tx,Ty,Tz = drawingData['testPos'][0]
    25182519        anglex,angley,anglez,oldxy = drawingData['Rotation']
     2520        if not len(oldxy): oldxy = list(newxy)
    25192521        Rx = G2lat.rotdMat(anglex,0)
    25202522        Ry = G2lat.rotdMat(angley,1)
     
    25622564    def SetRotation(newxy):       
    25632565        anglex,angley,anglez,oldxy = drawingData['Rotation']
     2566        if not len(oldxy): oldxy = list(newxy)
    25642567        dxy = newxy-oldxy
    25652568        anglex += dxy[1]*.25
     
    25702573    def SetRotationZ(newxy):                       
    25712574        anglex,angley,anglez,oldxy = drawingData['Rotation']
     2575        if not len(oldxy): oldxy = list(newxy)
    25722576        dxy = newxy-oldxy
    25732577        anglez += (dxy[0]+dxy[1])*.25
     
    27352739            else:
    27362740                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)
    2741             indx = np.array(ma.nonzero(rho)).T
    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)
    2747             view = np.array(drawingData['viewPoint'][0])
    2748             Rok = np.sum(np.inner(Amat,rhoXYZ-view).T**2,axis=1)>radius
     2741            if rho.size > 0:
     2742                steps = 1./np.array(rho.shape)
     2743                incre = np.where(VP>0,VP%steps,VP%steps-steps)
     2744                Vsteps = -np.array(VP/steps,dtype='i')
     2745                rho = np.roll(np.roll(np.roll(rho,Vsteps[0],axis=0),Vsteps[1],axis=1),Vsteps[2],axis=2)
     2746                indx = np.array(ma.nonzero(rho)).T
     2747                rhoXYZ = indx*steps+VP-incre
     2748                Nc = len(rhoXYZ)
     2749                rcube = 2000.*Vol/(ForthirdPI*Nc)
     2750                rmax = math.exp(math.log(rcube)/3.)**2
     2751                radius = min(drawingData['mapSize']**2,rmax)
     2752                view = np.array(drawingData['viewPoint'][0])
     2753                Rok = np.sum(np.inner(Amat,rhoXYZ-view).T**2,axis=1)>radius
     2754            else:
     2755                rhoXYZ = []
    27492756        Ind = GetSelectedAtoms()
    27502757        VS = np.array(Page.canvas.GetSize())
Note: See TracChangeset for help on using the changeset viewer.