Commit a1adf325 authored by payno's avatar payno

[ft] fix ft processing

parent aac155a0
Pipeline #12054 passed with stage
in 8 minutes and 50 seconds
......@@ -425,7 +425,7 @@
"data_file = os.path.join(PYMCA_DATA_DIR, \"EXAFS_Cu.dat\")\n",
"out = exec_workflow(scheme=scheme, input_=data_file)\n",
"assert isinstance(out, dict)\n",
"assert 'FTRadius' in out"
"assert 'FTRadius' in out['FT']"
]
},
{
......
......@@ -52,20 +52,8 @@ def pymca_ft(xas_obj):
_logger.error('Energy and or Mu is/are not specified, unable to '
'compute exafs')
return
pymca_xas.setConfiguration(_xas_obj.configuration)
pymca_xas.setSpectrum(energy=_xas_obj.spectrum['Energy'],
mu=_xas_obj.spectrum['Mu'])
pymca_xas.setConfiguration(_xas_obj.configuration)
spectrum = pymca_xas.processSpectrum()
mu = spectrum['Mu']
if 'EXAFSKValues' in _xas_obj.spectrum:
kValues = _xas_obj.spectrum['EXAFSKValues']
else:
e0 = spectrum["Edge"]
energy = spectrum['Energy']
mu = spectrum['Mu']
kValues = e2k(energy - e0)
# TODO: should be called _xas_obj.ft
_xas_obj.spectrum['FT'] = pymca_xas.fourierTransform(k=kValues, mu=mu, kMin=None, kMax=None)
_xas_obj.spectrum = pymca_xas.processSpectrum()
return _xas_obj.spectrum
......@@ -75,7 +75,8 @@ class TestWorkflow(unittest.TestCase):
def testProcess(self):
out = exec_workflow(scheme=self.scheme, input_=self.data_file)
assert isinstance(out, dict)
assert 'FTRadius' in out
assert 'FT' in out
assert 'FTRadius' in out['FT']
def suite():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment