Changeset 756 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Sep 11, 2012 2:28:29 PM (10 years ago)
Author:
vondreele
Message:

change display of density maps - now faster
implement a view direction command (not succcessfuly so far)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r755 r756  
    3939                'rho':[],'rhoMax':0.,'mapSize':10.0,'cutOff':50.,'Flip':False}
    4040# trig functions in degrees
    41 sind = lambda x: math.sin(x*math.pi/180.)
    42 tand = lambda x: math.tan(x*math.pi/180.)
    43 cosd = lambda x: math.cos(x*math.pi/180.)
    44 asind = lambda x: 180.*math.asin(x)/math.pi
     41sind = lambda x: np.sin(x*np.pi/180.)
     42tand = lambda x: np.tan(x*np.pi/180.)
     43cosd = lambda x: np.cos(x*np.pi/180.)
     44asind = lambda x: 180.*np.arcsin(x)/np.pi
     45acosd = lambda x: 180.*np.arccos(x)/np.pi
    4546
    4647class SymOpDialog(wx.Dialog):
     
    25812582               
    25822583            def OnViewDir(event):
     2584                event.Skip()
    25832585                Obj = event.GetEventObject()
    25842586                viewDir = Obj.GetValue().split()
    25852587                try:
    2586                     VD = [float(viewDir[i]) for i in range(3)]
     2588                    Amat,Bmat = G2lat.cell2AB(generalData['Cell'][1:7])
     2589                    VD = np.array([float(viewDir[i]) for i in range(3)])
     2590#                    VD = np.inner(Amat,VD)
     2591                    VD /= np.sqrt(np.sum(VD**2))
     2592                    V = np.array(drawingData['viewDir'])
     2593#                    V = np.inner(Amat,V)
     2594                    V /= np.sqrt(np.sum(V**2))
     2595                    A = acosd(np.sum(V*VD))
     2596                    VX = np.cross(V,VD)
     2597                    QV = G2mth.AVdeg2Q(A,VX)
     2598                    Q = drawingData['Quaternion']
     2599                    drawingData['Quaternion'] = G2mth.prodQQ(Q,QV)
    25872600                except (ValueError,IndexError):
    25882601                    VD = drawingData['viewDir']
    25892602                Obj.SetValue('%.3f %.3f %.3f'%(VD[0],VD[1],VD[2]))
    2590                 drawingData['viewDir'] = VP
     2603                drawingData['viewDir'] = VD
    25912604                G2plt.PlotStructure(G2frame,data)
    25922605                               
Note: See TracChangeset for help on using the changeset viewer.