Skip to content
Snippets Groups Projects
Commit 2cede8d8 authored by Cammille Carinan's avatar Cammille Carinan
Browse files

Fix sign of XAS

Closes #61

See merge request !207
parents d2ce5429 9e1416b6
No related branches found
No related tags found
1 merge request!207Fix sign of XAS
......@@ -6,6 +6,7 @@ unreleased
- **Bug fixes**
- fix :issue:`61` regarding sign of XAS in some cases :mr:`207`
- **Improvements**
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment