Skip to content

Commit 3f07f36

Browse files
committed
ugh forgot to save some changes
1 parent 50a9273 commit 3f07f36

File tree

6 files changed

+29
-21
lines changed

6 files changed

+29
-21
lines changed

GSASII/GSASIIfiles.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ def WriteInstprm(fp, InstPrm, InstPrm1, Sample={}, bank=None):
498498
parameters are written.
499499
'''
500500
if bank is not None:
501-
fp.write(f"#Bank {bank}: GSAS-II instrument parameter file; do not add/delete items!\n")
501+
#somehow, somewhere bank is becoming a float. Ensure it is an int here:
502+
fp.write(f"#Bank {int(bank)}: GSAS-II instrument parameter file; do not add/delete items!\n")
502503
indent = ' '
503504
else:
504505
fp.write("#GSAS-II instrument parameter file; do not add/delete items!\n")

GSASII/GSASIImath.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5103,10 +5103,10 @@ def setPeakparms(Parms,Parms2,pos,mag,ifQ=False,useFit=False):
51035103
pos = Parms['difC']*dsp
51045104
else:
51055105
dsp = pos/Parms['difC'][1]
5106-
if 'Pdabc' in Parms2:
5106+
if 'pdabc' in Parms2:
51075107
for x in ['sig-0','sig-1','sig-2','sig-q','X','Y','Z']:
51085108
ins[x] = Parms.get(x,[0.0,0.0])[ind]
5109-
Pdabc = Parms2['Pdabc'].T
5109+
Pdabc = Parms2['pdabc'].T
51105110
alp = np.interp(dsp,Pdabc[0],Pdabc[1])
51115111
bet = np.interp(dsp,Pdabc[0],Pdabc[2])
51125112
else:

GSASII/GSASIIpwd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ def getPeakProfile(dataType,parmDict,xdata,fixback,varyList,bakType):
17411741
except KeyError: #no more peaks to process
17421742
return yb+yc
17431743
else:
1744-
Pdabc = parmDict['Pdabc']
1744+
Pdabc = parmDict['pdabc']
17451745
difC = parmDict['difC']
17461746
iPeak = 0
17471747
while True:
@@ -2033,7 +2033,7 @@ def getPeakProfileDerv(dataType,parmDict,xdata,fixback,varyList,bakType):
20332033
break
20342034

20352035
else:
2036-
Pdabc = parmDict['Pdabc']
2036+
Pdabc = parmDict['pdabc']
20372037
difC = parmDict['difC']
20382038
iPeak = 0
20392039
while True:
@@ -2714,7 +2714,7 @@ def errPeakProfile(values,xdata,ydata,fixback,weights,dataType,parmdict,varylist
27142714
parmDict.update(bakDict)
27152715
parmDict.update(insDict)
27162716
parmDict.update(peakDict)
2717-
parmDict['Pdabc'] = [] #dummy Pdabc
2717+
parmDict['pdabc'] = [] #dummy Pdabc
27182718
parmDict.update(Inst2) #put in real one if there
27192719
if prevVaryList:
27202720
varyList = prevVaryList[:]

GSASII/GSASIIpwdGUI.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,6 +2687,8 @@ def OnSave(event):
26872687
'''Respond to the Instrument Parameters Operations/Save Profile menu
26882688
item: writes current parameters to a .instprm file
26892689
It does not write Bank n: on # line & thus can be used any time w/o clash of bank nos.
2690+
2691+
note: doesn't currently write extedened instrument parameters i.e. pdabc dictionary
26902692
'''
26912693
pth = G2G.GetExportPath(G2frame)
26922694
dlg = wx.FileDialog(G2frame, 'Set name to save GSAS-II instrument parameters file', pth, '',
@@ -3072,19 +3074,24 @@ def MakeLamSizer():
30723074
labelLst.append('2-theta')
30733075
elemKeysLst.append(['2-theta',1])
30743076
dspLst.append([10,2])
3075-
refFlgElem.append(None)
3076-
if 'pdabc' in Inst2:
3077-
Items = ['sig-0','sig-1','sig-2','sig-q','X','Y','Z']
3078-
subSizer.Add(wx.StaticText(G2frame.dataWindow,-1,' difC: '),0,WACV)
3079-
txt = '%8.2f'%(insVal['difC'])
3080-
subSizer.Add(wx.StaticText(G2frame.dataWindow,-1,txt.strip()),0,WACV)
3081-
labelLst.append('difC')
3082-
elemKeysLst.append(['difC',1])
3083-
dspLst.append([10,2])
3084-
refFlgElem.append(None)
3085-
subSizer.Add(wx.StaticText(G2frame.dataWindow,-1,' alpha, beta: fixed by table'),0,WACV)
3086-
else:
3087-
Items = ['difC','difA','difB','Zero','alpha','beta-0','beta-1','beta-q','sig-0','sig-1','sig-2','sig-q','X','Y','Z']
3077+
refFlgElem.append(None)
3078+
3079+
#note: this if statement is commented out as current implementation of pdabc is not
3080+
# intended to exclude diffing difC, difA, difB, etc. from refinement.
3081+
# TODO: check this is OK with other applications (work around is "show multiple" in GUI: which exposes everything")
3082+
# if 'pdabc' in Inst2:
3083+
# Items = ['sig-0','sig-1','sig-2','sig-q','X','Y','Z']
3084+
# subSizer.Add(wx.StaticText(G2frame.dataWindow,-1,' difC: '),0,WACV)
3085+
# txt = '%8.2f'%(insVal['difC'])
3086+
# subSizer.Add(wx.StaticText(G2frame.dataWindow,-1,txt.strip()),0,WACV)
3087+
# labelLst.append('difC')
3088+
# elemKeysLst.append(['difC',1])
3089+
# dspLst.append([10,2])
3090+
# refFlgElem.append(None)
3091+
# subSizer.Add(wx.StaticText(G2frame.dataWindow,-1,' alpha, beta: fixed by table'),0,WACV)
3092+
# else:
3093+
Items = ['difC','difA','difB','Zero','alpha','beta-0','beta-1','beta-q','sig-0','sig-1','sig-2','sig-q','X','Y','Z']
3094+
30883095
mainSizer.Add((5,5),0)
30893096
mainSizer.Add(subSizer)
30903097
mainSizer.Add((5,5),0)

GSASII/GSASIIstrIO.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3850,7 +3850,7 @@ def PrintSampleParms(Sample):
38503850
# create histDict1 if second instrument parameters entry is not empty
38513851
if Inst[1]:
38523852
for key in Inst[1]:
3853-
histDict1[pfx+'Pdabc']=Inst[1][key]
3853+
histDict1[pfx+'pdabc']=Inst[1][key]
38543854

38553855
Type,instDict,insVary = GetInstParms(hId,Inst[0])
38563856

GSASII/GSASIIstrMath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3787,7 +3787,7 @@ def GetReflSigGamTOF(refl,im,G,GB,phfx,calcControls,parmDict,histDict1,hfx):
37873787
gam += Sgam
37883788

37893789
if histDict1:
3790-
pdabc = histDict1[hfx+'Pdabc']
3790+
pdabc = histDict1[hfx+'pdabc']
37913791
refl[4+im] #d-spacing
37923792
sigTable = np.interp(refl[4+im],pdabc["d"],pdabc["sig"])
37933793

0 commit comments

Comments
 (0)