Changeset 4080
- Timestamp:
- Aug 7, 2019 11:35:30 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIddataGUI.py
r4047 r4080 28 28 import GSASIIctrlGUI as G2G 29 29 import numpy as np 30 import numpy.linalg as nl 30 31 31 32 WACV = wx.ALIGN_CENTER_VERTICAL … … 178 179 pass 179 180 Obj.SetValue("%.5f"%(UseList[G2frame.hist]['Size'][4][pid])) #reset in case of error 181 wx.CallAfter(UpdateDData,G2frame,DData,data,G2frame.hist) 180 182 else: 181 183 try: … … 405 407 dataSizer.Add(sizeVal,0,WACV|wx.BOTTOM,5) 406 408 return dataSizer 407 409 408 410 def EllSizeDataSizer(): 409 411 parms = zip(['S11','S22','S33','S12','S13','S23'],UseList[G2frame.hist]['Size'][4], 410 412 UseList[G2frame.hist]['Size'][5],range(6)) 411 dataSizer = wx.FlexGridSizer(0,6,5,5) 412 for Pa,val,ref,Id in parms: 413 dataSizer = wx.BoxSizer(wx.VERTICAL) 414 # dataSizer = wx.FlexGridSizer(0,6,5,5) 415 matrixSizer = wx.FlexGridSizer(0,6,5,5) 416 Sij = [] 417 for Pa,val,ref,id in parms: 413 418 sizeRef = wx.CheckBox(DData,wx.ID_ANY,label=Pa) 414 419 sizeRef.thisown = False 415 420 sizeRef.SetValue(ref) 416 Indx[sizeRef.GetId()] = [G2frame.hist, Id]421 Indx[sizeRef.GetId()] = [G2frame.hist,id] 417 422 sizeRef.Bind(wx.EVT_CHECKBOX, OnSizeRef) 418 dataSizer.Add(sizeRef,0,WACV) 419 # azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff) 423 # dataSizer.Add(sizeRef,0,WACV) 424 matrixSizer.Add(sizeRef,0,WACV) 425 # azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff) 420 426 sizeVal = wx.TextCtrl(DData,wx.ID_ANY,'%.3f'%(val),style=wx.TE_PROCESS_ENTER) 421 Indx[sizeVal.GetId()] = [G2frame.hist,Id] 427 # Create Sij matrix 428 Sij += [val] 429 Indx[sizeVal.GetId()] = [G2frame.hist,id] 422 430 sizeVal.Bind(wx.EVT_TEXT_ENTER,OnSizeVal) 423 431 sizeVal.Bind(wx.EVT_KILL_FOCUS,OnSizeVal) 424 dataSizer.Add(sizeVal,0,WACV) 432 # dataSizer.Add(sizeVal,0,WACV) 433 matrixSizer.Add(sizeVal,0,WACV) 434 dataSizer.Add(matrixSizer, 0, WACV) 435 Esize,Rsize = nl.eigh(G2lat.U6toUij(np.asarray(Sij))) 436 lengths = Esize 437 G,g = G2lat.cell2Gmat(data['General']['Cell'][1:7]) #recip & real metric tensors 438 GA,GB = G2lat.Gmat2AB(G) #Orthogonalization matricies 439 hkls = [x/(sum(x**2)**0.5) for x in np.dot(Rsize, GA)] 440 Ids = np.argsort(lengths) 441 dataSizer.Add(wx.StaticText(DData,label=' Principal ellipsoid components:'),0,WACV) 442 compSizer = wx.FlexGridSizer(3,3,5,5) 443 Axes = [' Short Axis:',' Middle Axis:',' Long Axis:'] 444 for Id in Ids: 445 compSizer.Add(wx.StaticText(DData,label=Axes[Id]),0,WACV) 446 compSizer.Add(wx.StaticText(DData,label='(%.3f, %.3f, %.3f) '%(hkls[Id][0], hkls[Id][1], hkls[Id][2])),0,WACV) 447 compSizer.Add(wx.StaticText(DData,label='Length: %.3f'%lengths[Id]),0,WACV) 448 dataSizer.Add(compSizer) 425 449 return dataSizer 426 450 -
trunk/GSASIIpwd.py
r4048 r4080 1112 1112 1113 1113 def ellipseSize(H,Sij,GB): 1114 ' needs a doc string'1114 'Implements r=1/sqrt(sum((1/S)*(q.v)^2) per note from Alexander Brady' 1115 1115 HX = np.inner(H.T,GB) 1116 1116 lenHX = np.sqrt(np.sum(HX**2)) 1117 1117 Esize,Rsize = nl.eigh(G2lat.U6toUij(Sij)) 1118 R = np.inner(HX/lenHX,Rsize)* Esize #want column length for hkl in crystal1119 lenR = np.sqrt(np.sum(R**2))1118 R = np.inner(HX/lenHX,Rsize)**2*Esize #want column length for hkl in crystal 1119 lenR = 1./np.sqrt(np.sum(R)) 1120 1120 return lenR 1121 1121
Note: See TracChangeset
for help on using the changeset viewer.