Skip to content
Snippets Groups Projects

Fix sign of XAS

Merged Loïc Le Guyader requested to merge XAS_sign into master
1 file
+ 3
10
Compare changes
  • Side-by-side
  • Inline
@@ -174,19 +174,12 @@ def xas(nrun, bins=None, Iokey='SCS_SA3', Itkey='MCP3peaks', nrjkey='nrj',
""" Select which fields to use as I0 and which to use as I1
"""
if 'mcp' in Iokey.lower():
Io_sign = -1
else:
Io_sign = 1
if 'mcp' in Itkey.lower():
It_sign = -1
else:
It_sign = 1
if len(data) == 0:
return absorption([], [], fluorescence)
else:
Io_sign = np.sign(np.nanmean(data['Io']))
It_sign = np.sign(np.nanmean(data['It']))
return absorption(It_sign*data['It'], Io_sign*data['Io'],
fluorescence)
Loading