Changeset 756 for trunk/GSASIIphsGUI.py
 Timestamp:
 Sep 11, 2012 2:28:29 PM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIphsGUI.py
r755 r756 39 39 'rho':[],'rhoMax':0.,'mapSize':10.0,'cutOff':50.,'Flip':False} 40 40 # 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 41 sind = lambda x: np.sin(x*np.pi/180.) 42 tand = lambda x: np.tan(x*np.pi/180.) 43 cosd = lambda x: np.cos(x*np.pi/180.) 44 asind = lambda x: 180.*np.arcsin(x)/np.pi 45 acosd = lambda x: 180.*np.arccos(x)/np.pi 45 46 46 47 class SymOpDialog(wx.Dialog): … … 2581 2582 2582 2583 def OnViewDir(event): 2584 event.Skip() 2583 2585 Obj = event.GetEventObject() 2584 2586 viewDir = Obj.GetValue().split() 2585 2587 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) 2587 2600 except (ValueError,IndexError): 2588 2601 VD = drawingData['viewDir'] 2589 2602 Obj.SetValue('%.3f %.3f %.3f'%(VD[0],VD[1],VD[2])) 2590 drawingData['viewDir'] = V P2603 drawingData['viewDir'] = VD 2591 2604 G2plt.PlotStructure(G2frame,data) 2592 2605
Note: See TracChangeset
for help on using the changeset viewer.