Changeset 4534 for trunk/GSASIIddataGUI.py
- Timestamp:
- Jul 27, 2020 10:42:49 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIddataGUI.py
r4523 r4534 19 19 from __future__ import division, print_function 20 20 import wx 21 import numpy as np 22 import numpy.linalg as nl 21 23 import GSASIIpath 22 24 GSASIIpath.SetVersionNumber("$Revision$") … … 27 29 import GSASIIphsGUI as G2phsGUI 28 30 import GSASIIctrlGUI as G2G 29 import numpy as np 30 import numpy.linalg as nl 31 import GSASIIpy3 as G2py3 31 32 32 33 WACV = wx.ALIGN_CENTER_VERTICAL … … 392 393 UseList[G2frame.hist]['HStrain'][1][pid] = Obj.GetValue() 393 394 395 hSizer = wx.BoxSizer(wx.VERTICAL) 394 396 hstrainSizer = wx.FlexGridSizer(0,6,5,5) 395 397 Hsnames = G2spc.HStrainNames(SGData) 396 398 parms = zip(Hsnames,UseList[G2frame.hist]['HStrain'][1],range(len(Hsnames))) 399 allzero = True 397 400 for Pa,ref,Id in parms: 398 401 hstrainRef = wx.CheckBox(DData,wx.ID_ANY,label=Pa) … … 402 405 hstrainRef.Bind(wx.EVT_CHECKBOX, OnHstrainRef) 403 406 hstrainSizer.Add(hstrainRef,0,WACV|wx.LEFT,5) 404 hstrainVal = G2G.ValidatedTxtCtrl(DData,UseList[G2frame.hist]['HStrain'][0],Id,nDig=(10,3,'g')) 407 hstrainVal = G2G.ValidatedTxtCtrl(DData, 408 UseList[G2frame.hist]['HStrain'][0],Id,nDig=(10,3,'g'), 409 OnLeave=OnNewValueReDraw) 410 if abs(UseList[G2frame.hist]['HStrain'][0][Id]) > 1e-8: 411 allzero = False 405 412 hstrainSizer.Add(hstrainVal,0,WACV) 406 return hstrainSizer 413 hSizer.Add(hstrainSizer,0,WACV) 414 if not allzero: # show Dij shifted unit cell 415 DijVals = UseList[G2frame.hist]['HStrain'][0][:] 416 # apply the Dij values to the reciprocal cell 417 newA = [] 418 Dijdict = dict(zip(G2spc.HStrainNames(SGData),DijVals)) 419 for Aij,lbl in zip(G2lat.cell2A(data['General']['Cell'][1:7]), 420 ['D11','D22','D33','D12','D13','D23']): 421 newA.append(Aij + Dijdict.get(lbl,0.0)) 422 cell = G2lat.A2cell(newA) # convert back to direct cell 423 laue = generalData['SGData']['SGLaue'] 424 if laue == '2/m': 425 laue += generalData['SGData']['SGUniq'] 426 for cellGUI in G2py3.cellGUIlist: 427 if laue in cellGUI[0]: 428 useGUI = cellGUI 429 break 430 else: 431 return hSizer 432 cellstr = '' 433 for txt,fmt,ifEdit,Id in zip(*useGUI[2:]): 434 if cellstr: cellstr += ", " 435 cellstr += txt+fmt.format(cell[Id]) 436 cellstr += ', Vol = {:.3f}'.format(G2lat.calc_V(newA)) 437 hSizer.Add(wx.StaticText(DData,wx.ID_ANY,' '+cellstr),0,WACV) 438 return hSizer 407 439 408 440 def PoTopSizer(POData): … … 967 999 968 1000 ###################################################################### 969 # Beginning of UpdateDData execution here1001 ### Beginning of UpdateDData execution here 970 1002 ###################################################################### 971 1003 G2frame.SetStatusText('',1)
Note: See TracChangeset
for help on using the changeset viewer.