Changeset 3258
- Timestamp:
- Feb 4, 2018 12:34:11 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r3256 r3258 5166 5166 self.DataEdit.Append(G2G.wxID_HKLFADD,'Add single crystal histograms','Select new single crystal histograms to be used for this phase') 5167 5167 self.DataEdit.Append(G2G.wxID_DATADELETE,'Remove histograms','Remove histograms from use for this phase') 5168 G2G.Define_wxId('wxID_DATADIJ') 5169 self.DataEdit.Append(G2G.wxID_DATADIJ,'Apply Strain to Lattice Constants', 5170 'Shift cell by Dij of selected histogram') 5168 5171 self.PostfillDataMenu() 5169 5172 … … 6465 6468 Histograms,Phases = G2frame.GetUsedHistogramsAndPhasesfromTree() 6466 6469 for phase in Phases: 6467 print('Updating {} from histogram{}'.format(phase,histNames[sel]))6470 print('Updating {} from Seq. Ref. row {}'.format(phase,histNames[sel])) 6468 6471 Phase = Phases[phase] 6469 6472 General = Phase['General'] … … 6473 6476 pId = Phase['pId'] 6474 6477 pfx = str(pId)+'::' 6475 if cell[0]:6476 6477 6478 6478 # there should not be any changes to the cell because those terms are not refined 6479 A,sigA = G2stIO.cellFill(pfx,SGData,parmDict,{}) 6480 cell[1:7] = G2lat.A2cell(A) 6481 cell[7] = G2lat.calc_V(A) 6479 6482 textureData = General['SH Texture'] 6480 6483 if textureData['Order']: … … 7028 7031 #G2frame.dataDisplay.Refresh() # shows colored text on mac 7029 7032 G2frame.dataWindow.SetDataSize() 7030 7033 7031 7034 ################################################################################ 7032 7035 ##### Main PWDR panel -
trunk/GSASIIphsGUI.py
r3257 r3258 6692 6692 dlg.Destroy() 6693 6693 wx.CallAfter(G2ddG.UpdateDData,G2frame,DData,data) 6694 6694 6695 def OnDataApplyStrain(event): 6696 SGData = data['General']['SGData'] 6697 DijVals = data['Histograms'][G2frame.hist]['HStrain'][0][:] 6698 # apply the Dij values to the reciprocal cell 6699 newA = [] 6700 Dijdict = dict(zip(G2spc.HStrainNames(SGData),DijVals)) 6701 for Aij,lbl in zip(G2lat.cell2A(data['General']['Cell'][1:7]), 6702 ['D11','D22','D33','D12','D13','D23']): 6703 newA.append(Aij + Dijdict.get(lbl,0.0)) 6704 # convert back to direct cell 6705 data['General']['Cell'][1:7] = G2lat.A2cell(newA) 6706 data['General']['Cell'][7] = G2lat.calc_V(newA) 6707 # subtract the selected histograms Dij values from all for this phase 6708 for hist in data['Histograms']: 6709 for i,val in enumerate(DijVals): 6710 data['Histograms'][hist]['HStrain'][0][i] -= val 6711 # for hist in sorted(data['Histograms']): # list effective lattice constants applying Dij values 6712 # DijVals = data['Histograms'][hist]['HStrain'][0] 6713 # newA = [] 6714 # Dijdict = dict(zip(G2spc.HStrainNames(SGData),DijVals)) 6715 # for Aij,lbl in zip(G2lat.cell2A(data['General']['Cell'][1:7]), 6716 # ['D11','D22','D33','D12','D13','D23']): 6717 # newA.append(Aij + Dijdict.get(lbl,0.0)) 6718 # print(hist, G2lat.A2cell(newA)[:3], G2lat.calc_V(newA)) 6719 wx.CallAfter(G2ddG.UpdateDData,G2frame,DData,data) 6720 6695 6721 ################################################################################ 6696 6722 ##### Rigid bodies … … 8920 8946 G2frame.Bind(wx.EVT_MENU, OnHklfAdd, id=G2G.wxID_HKLFADD) 8921 8947 G2frame.Bind(wx.EVT_MENU, OnDataDelete, id=G2G.wxID_DATADELETE) 8948 G2frame.Bind(wx.EVT_MENU, OnDataApplyStrain, id=G2G.wxID_DATADIJ) 8922 8949 # Atoms 8923 8950 FillSelectPageMenu(TabSelectionIdDict, G2frame.dataWindow.AtomsMenu)
Note: See TracChangeset
for help on using the changeset viewer.