Skip to content

Commit 025a877

Browse files
committed
put plot of Fo-Fc vs Fc extinction check in error analysis; remove from HKLF menu.
1 parent 604ee59 commit 025a877

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

GSASII/GSASIIdataGUI.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6642,7 +6642,7 @@ def _makemenu(): # routine to create menu when first used
66426642
self.PWDRMenu = _makemenu
66436643

66446644
# HKLF - many wxIDs defined in PWDR & SASD above
6645-
G2G.Define_wxId('wxID_3DALLHKLPLOT','wxID_MERGEHKL','wxID_FIXFSQSQDATA','wxID_FOVSFCPLOT')
6645+
G2G.Define_wxId('wxID_3DALLHKLPLOT','wxID_MERGEHKL','wxID_FIXFSQSQDATA')
66466646
def _makemenu(): # routine to create menu when first used
66476647
self.HKLFMenu = wx.MenuBar()
66486648
self.PrefillDataMenu(self.HKLFMenu)
@@ -6651,7 +6651,6 @@ def _makemenu(): # routine to create menu when first used
66516651
self.ErrorAnal.Append(G2G.wxID_PWDANALYSIS,'Error Analysis','Error analysis on single crystal data')
66526652
self.ErrorAnal.Append(G2G.wxID_MERGEHKL,'Merge HKLs','Transform & merge HKLF data to new histogram')
66536653
self.ErrorAnal.Append(G2G.wxID_1DHKLSTICKPLOT,'Plot 1D HKLs','Plot of HKLs from single crystal data in 1D')
6654-
self.ErrorAnal.Append(G2G.wxID_FOVSFCPLOT,'Plot Fo-Fc vs Fc','Plot Fo-Fc vs Fc from single crystal data')
66556654
self.ErrorAnal.Append(G2G.wxID_3DALLHKLPLOT,'Plot all 3D HKLs','Plot HKLs from all single crystal data in 3D')
66566655
self.ErrorAnal.Append(G2G.wxID_FIXFSQSQDATA,'Fix (F^2)^2 data','Fix F^2 data imported as F')
66576656
# self.ErrorAnal.Append(G2G.wxID_PWDCOPY,'Copy params','Copy of HKLF parameters') #unused
@@ -8054,14 +8053,6 @@ def OnPlotAll3DHKL(event):
80548053
'Scale':1.0,'oldxy':[],'viewDir':[1,0,0]},'Super':Super,'SuperVec':SuperVec}
80558054
G2plt.Plot3DSngl(G2frame,newPlot=True,Data=controls,hklRef=refList,Title=phaseName)
80568055

8057-
def OnPlotFoVsFc(event):
8058-
''' Plots Fo-Fc & 1/ExtC vs Fc for single crystal data '''
8059-
refList = data[1]['RefList']
8060-
XY = np.array([xy[8+Super:10+Super] for xy in refList if xy[3+Super]>0])
8061-
XE = np.array([[np.sqrt(xy[9+Super]),1./xy[11+Super]] for xy in refList if xy[3+Super]>0]).T
8062-
XY = np.sqrt(np.abs(XY)).T
8063-
G2plt.PlotXY(G2frame,[[XY[1],XY[0]-XY[1]],],XY2=[XE,],labelX='|Fc|',labelY='|Fo|-|Fc|, 1/ExtC',newPlot=False,
8064-
Title='|Fo|-|Fc| vs |Fc|',lines=False,points2=True,names=['|Fo|-|Fc|',],names2=['1/ExtC',])
80658056

80668057
def OnMergeHKL(event):
80678058
'''Merge HKLF data sets to unique set according to Laue symmetry'''
@@ -8207,8 +8198,19 @@ def OnFixFsqFsq(event):
82078198
def OnErrorAnalysis(event):
82088199
'''Plots an "Abrams" plot - sorted delta/sig across data set.
82098200
Should be straight line of slope 1 - never is'''
8201+
def OnPlotFoFcVsFc(kind):
8202+
''' Extinction check, plots Fo-Fc & 1/ExtC vs Fc for single crystal data '''
8203+
iFo,iFc,iExt = 8,9,11
8204+
refList = data[1]['RefList']
8205+
XY = np.array([xy[iFo+Super:1+iFc+Super] for xy in refList if xy[3+Super]>0])
8206+
XE = np.array([[np.sqrt(xy[iFc+Super]),1./xy[iExt+Super]] for xy in refList if xy[3+Super]>0]).T
8207+
XY = np.sqrt(np.abs(XY)).T
8208+
G2plt.PlotXY(G2frame,[[XY[1],XY[0]-XY[1]],],XY2=[XE,],labelX='|Fc|',labelY='|Fo|-|Fc|, 1/ExtC',newPlot=False,
8209+
Title='Extinction check',lines=False,points2=True,names=['|Fo|-|Fc|',],names2=['1/ExtC',])
82108210
G2plt.PlotDeltSig(G2frame,kind)
8211-
8211+
if kind in ['HKLF',]:
8212+
OnPlotFoFcVsFc(kind)
8213+
82128214
# def OnCompression(event):
82138215
# data[0] = int(comp.GetValue())
82148216

@@ -8265,7 +8267,8 @@ def OnEditMag(**args):
82658267
#end patches
82668268
if kind in ['PWDR','SASD','REFD']:
82678269
SetDataMenuBar(G2frame,G2frame.dataWindow.PWDRMenu)
8268-
G2frame.Bind(wx.EVT_MENU, OnErrorAnalysis, id=G2G.wxID_PWDANALYSIS)
8270+
if kind in ['PWDR',]:
8271+
G2frame.Bind(wx.EVT_MENU, OnErrorAnalysis, id=G2G.wxID_PWDANALYSIS)
82698272
G2frame.Bind(wx.EVT_MENU, onCopySelectedItems, id=G2G.wxID_PWDCOPY)
82708273
G2frame.Bind(wx.EVT_MENU, onCopyPlotCtrls, id=G2G.wxID_PLOTCTRLCOPY)
82718274
elif kind in ['HKLF',]:
@@ -8275,7 +8278,7 @@ def OnEditMag(**args):
82758278
G2frame.Bind(wx.EVT_MENU, OnPlot1DHKL, id=G2G.wxID_1DHKLSTICKPLOT)
82768279
G2frame.Bind(wx.EVT_MENU, OnPlot3DHKL, id=G2G.wxID_PWD3DHKLPLOT)
82778280
G2frame.Bind(wx.EVT_MENU, OnPlotAll3DHKL, id=G2G.wxID_3DALLHKLPLOT)
8278-
G2frame.Bind(wx.EVT_MENU, OnPlotFoVsFc, id=G2G.wxID_FOVSFCPLOT)
8281+
# G2frame.Bind(wx.EVT_MENU, OnPlotFoVsFc, id=G2G.wxID_FOVSFCPLOT)
82798282
G2frame.Bind(wx.EVT_MENU, OnFixFsqFsq, id=G2G.wxID_FIXFSQSQDATA)
82808283
if kind == 'PWDR':
82818284
lbl = 'Powder'

GSASII/GSASIIplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2494,7 +2494,7 @@ def OnMotion(event):
24942494
def Draw():
24952495
global xylim
24962496
Plot.clear()
2497-
Plot.set_title(Title)
2497+
Plot.set_title(Title,fontsize=16)
24982498
Plot.set_xlabel(r''+labelX,fontsize=16)
24992499
Plot.set_ylabel(r''+labelY,fontsize=16)
25002500
Plot.tick_params(labelsize=14)

GSASII/GSASIIstrMath.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,14 +2751,14 @@ def SCExtinction(ref,im,phfx,hfx,pfx,calcControls,parmDict,varyList):
27512751
DScorr = 1.0
27522752
if 'Primary' in calcControls[phfx+'EType']:
27532753
PLZ *= 1.5
2754-
DScorr = 1.+parmDict[phfx+'Ma']*ref[4+im]+parmDict[phfx+'Mb']*ref[4+im]**2
2754+
DScorr = 1.+parmDict[phfx+'Ma']/ref[4+im]+parmDict[phfx+'Mb']/ref[4+im]**2
27552755
else:
27562756
if 'C' in parmDict[hfx+'Type']:
27572757
PLZ *= calcControls[phfx+'Tbar']
27582758
else: #'T'
27592759
PLZ *= ref[13+im] #t-bar
27602760
if 'Primary' in calcControls[phfx+'EType']:
2761-
PLZ *= 1.5 #why?
2761+
PLZ *= 1.5
27622762
PSIG = parmDict[phfx+'Ep']
27632763
elif 'I & II' in calcControls[phfx+'EType']:
27642764
PSIG = parmDict[phfx+'Eg']/np.sqrt(1.+(parmDict[phfx+'Es']*PL/parmDict[phfx+'Eg'])**2)
@@ -2786,15 +2786,15 @@ def SCExtinction(ref,im,phfx,hfx,pfx,calcControls,parmDict,varyList):
27862786
extCor = np.sqrt(PF4)
27872787
PF3 = 0.5*(CL+2.*AL*PF/(1.+BL*PF)-AL*PF**2*BL/(1.+BL*PF)**2)/(PF4*extCor)
27882788

2789-
dervCor = (1.+PF)*PF3 #extinction corr for other derivatives
2789+
dervCor = (1.+PF)*PF3/DScorr #extinction corr for other derivatives
27902790
if 'Primary' in calcControls[phfx+'EType']:
27912791
if phfx+'Ep' in varyList:
2792-
dervDict[phfx+'Ep'] = -ref[7+im]*PLZ*PF3*DScorr
2792+
dervDict[phfx+'Ep'] = -ref[7+im]*PLZ*PF3/DScorr
27932793
if phfx+'Ma' in varyList:
2794-
dervDict[phfx+'Ma'] = -extCor*ref[4+im]
2794+
dervDict[phfx+'Ma'] = -extCor/ref[4+im]
27952795
if phfx+'Mb' in varyList:
2796-
dervDict[phfx+'Mb'] = -extCor*ref[4+im]**2
2797-
extCor *= DScorr
2796+
dervDict[phfx+'Mb'] = -extCor/ref[4+im]**2
2797+
extCor /= DScorr
27982798
if 'II' in calcControls[phfx+'EType'] and phfx+'Es' in varyList:
27992799
dervDict[phfx+'Es'] = -ref[7+im]*PLZ*PF3*(PSIG/parmDict[phfx+'Es'])**3
28002800
if 'I' in calcControls[phfx+'EType'] and phfx+'Eg' in varyList:

0 commit comments

Comments
 (0)