Skip to content

Commit 2c22aca

Browse files
committed
change calibrate weights; weren't proper before
fix behavior of plotting after change to peak fit table. Won't replot after changes to refine columns.
1 parent 30ed908 commit 2c22aca

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

GSASII/GSASIIpwd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,9 +2319,9 @@ def errPeakPos(values,peakDsp,peakPos,peakWt,dataType,parmDict,varyList):
23192319
shft = -const*(parmDict['DisplaceX']*npcosd(calcPos)+parmDict['DisplaceY']*npsind(calcPos))+parmDict['Zero']
23202320
else:
23212321
shft = -2.0*const*(parmDict['Shift']*npcosd(calcPos/2.0)+parmDict['Zero'])
2322-
return np.sqrt(peakWt)*(calcPos+shft-peakPos)
2322+
return peakWt*(calcPos+shft-peakPos)
23232323
else:
2324-
return np.sqrt(peakWt)*(calcPos-peakPos)
2324+
return peakWt*(calcPos-peakPos)
23252325

23262326
peakPos = []
23272327
peakDsp = []

GSASII/GSASIIpwdGUI.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ def OnClearPeaks(event):
10451045
UpdatePeakGrid(G2frame,peaks)
10461046
G2pwpl.PlotPatterns(G2frame,plotType='PWDR')
10471047

1048-
def OnPeakFit(oneCycle=False,noFit=False):
1048+
def OnPeakFit(oneCycle=False,noFit=False,noPlot=False):
10491049
'Do peak fitting by least squares'
10501050
SaveState()
10511051
controls = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.root, 'Controls'))
@@ -1100,7 +1100,8 @@ def OnPeakFit(oneCycle=False,noFit=False):
11001100
bxye = GetFileBackground(G2frame,data,background,scale=False)
11011101
if noFit:
11021102
results = G2pwd.DoPeakFit(None,peaksplus,background,limits,inst,inst2,data,bxye,[],oneCycle,controls,wtFactor,noFit=True)
1103-
G2pwpl.PlotPatterns(G2frame,plotType='PWDR')
1103+
if not noPlot:
1104+
G2pwpl.PlotPatterns(G2frame,plotType='PWDR')
11041105
return
11051106
# try:
11061107
dlg = wx.ProgressDialog('Residual','Peak fit Rwp = ',101,parent=G2frame,
@@ -1199,7 +1200,7 @@ def KeyEditPeakGrid(event):
11991200
else:
12001201
event.Skip()
12011202
return
1202-
G2pwpl.PlotPatterns(G2frame,plotType='PWDR')
1203+
# G2pwpl.PlotPatterns(G2frame,plotType='PWDR')
12031204
wx.CallAfter(UpdatePeakGrid,G2frame,data)
12041205

12051206
def SelectVars(rows):
@@ -1278,12 +1279,13 @@ def onCellListDClick(event):
12781279

12791280
def RefreshPeakGrid(event):
12801281
'recompute & plot the peaks any time a value in the table is edited'
1282+
col = event.GetCol()
12811283
if 'LF' in Inst['Type'][0]:
12821284
for i in range(len(data['LFpeaks'])):
12831285
data['peaks'][i][2:] = data['LFpeaks'][i]
12841286
wx.CallAfter(UpdatePeakGrid,G2frame,data)
12851287
if data['peaks']:
1286-
OnPeakFit(noFit=True)
1288+
OnPeakFit(noFit=True,noPlot=col%2)
12871289

12881290
def ToggleXtraMode(event):
12891291
'''Switch "Extra Peak" mode in response to button'''

0 commit comments

Comments
 (0)