Skip to content

Commit 12ec78f

Browse files
committed
use correct form factor for normalization of micro-EM charge flipping
1 parent fbc65e0 commit 12ec78f

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

GSASII/GSASIIElem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ def SetupGeneral(data, dirname):
915915
F000N = 0.
916916
F000E = 0.
917917
ElTypes = [StripValence(elem) for elem in generalData['AtomTypes']]
918-
EFFtables = GetEFFtable(ElTypes) # broken for charged species
918+
EFFtables = GetEFFtable(ElTypes)
919919
for i,elem in enumerate(generalData['AtomTypes']):
920920
F000X += generalData['NoAtoms'][elem]*generalData['Z']
921921
isotope = generalData['Isotope'][elem]

GSASII/GSASIImath.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4246,16 +4246,26 @@ def ChargeFlip(data,reflDict,pgbar):
42464246
:returns: type name: description
42474247
42484248
'''
4249+
print('Charge flip data type: ',reflDict['Type'])
42494250
generalData = data['General']
42504251
mapData = generalData['Map']
42514252
flipData = generalData['Flip']
42524253
FFtable = {}
4253-
if 'None' not in flipData['Norm element']:
4254+
if 'None' not in flipData['Norm element'] and 'N' not in reflDict['Type']:
42544255
normElem = flipData['Norm element'].upper()
4255-
FFs = G2el.GetFormFactorCoeff(normElem.split('+')[0].split('-')[0])
4256+
if 'X' in reflDict['Type']:
4257+
FFs = G2el.GetFormFactorCoeff(normElem.split('+')[0].split('-')[0])
4258+
else:
4259+
FFs = G2el.GetEFormFactorCoeff(normElem)
42564260
for ff in FFs:
42574261
if ff['Symbol'] == normElem:
42584262
FFtable.update(ff)
4263+
if 'X' in reflDict['Type']:
4264+
print('%s normalizing form factor: fa: %s, fb: %s, fc: %s'%(FFtable['Symbol'],
4265+
str(FFtable['fa']),str(FFtable['fb']),str(FFtable['fc'])))
4266+
else:
4267+
print('%s normalizing form factor: fa: %s, fb: %s'%(FFtable['Symbol'],
4268+
str(FFtable['fa']),str(FFtable['fb'])))
42594269
dmin = flipData['GridStep']*2.
42604270
SGData = generalData['SGData']
42614271
SGMT = np.array([ops[0].T for ops in SGData['SGOps']])

GSASII/GSASIIphsGUI.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,8 +2515,8 @@ def OnTestHKL(event):
25152515
line2Sizer.Add(wx.StaticText(General,label=' Map grid step: '),0,WACV)
25162516
flipRes = G2G.ValidatedTxtCtrl(General,Flip,'GridStep',nDig=(10,2),xmin=0.10,xmax=2.)
25172517
line2Sizer.Add(flipRes,0,WACV)
2518-
line2Sizer.Add(wx.StaticText(General,label=' k-Factor (0.1-1.2): '),0,WACV)
2519-
kFactor = G2G.ValidatedTxtCtrl(General,Flip,'k-factor',nDig=(10,3),xmin=0.1,xmax=1.2)
2518+
line2Sizer.Add(wx.StaticText(General,label=' k-Factor (0.01-1.2): '),0,WACV)
2519+
kFactor = G2G.ValidatedTxtCtrl(General,Flip,'k-factor',nDig=(10,3),xmin=0.01,xmax=1.2)
25202520
line2Sizer.Add(kFactor,0,WACV)
25212521
line2Sizer.Add(wx.StaticText(General,label=' k-Max (>=10.0): '),0,WACV)
25222522
kMax = G2G.ValidatedTxtCtrl(General,Flip,'k-Max',nDig=(10,1),xmin=10.)

GSASII/GSASIIpwdGUI.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3404,7 +3404,8 @@ def onPrmPlot(event):
34043404
RefObj = {}
34053405
Inst2 = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
34063406
G2frame.PatternId,'Instrument Parameters'))[1]
3407-
G2gd.SetDataMenuBar(G2frame)
3407+
RefData = G2frame.GPXtree.GetItemPyData(G2frame.PatternId)[1]
3408+
RefData['Type'] = data['Type'][0]
34083409
#patch
34093410
if 'P' in insVal['Type']: #powder data
34103411
if 'C' in insVal['Type']: #constant wavelength

0 commit comments

Comments
 (0)