Load chi.dat generated by FEFF8 directly into Larix?
Dear all, I am trying to fit a theoretical EXAFS spectrum (chi.dat) that was generated via FEFF8 from multiple snapshots from an AIMD trajectory. I can import the chi data into Athena, and from there into Artemis where I can fit it using the standard shell-by-shell routine. However, I cannot import the chi data into Larix and fit it in the FEFF fitting panel. I was able to load the file as XY data and (via the Larch buffer) assign k and chi so that Larix recognizes it in the EXAFS panel. I was also able to generate the Fourier transform (via the Larch buffer), but got no further. So my question is this: Is it possible to fit theoretical chi spectra generated by FEFF8 in Larix? It seems like it is necessary to use Larch directly? Are there any work arounds? Thanks, Sharon
Hi Sharon,
At the moment, Larix does not have a "read chi.dat" function exposed. This should probably be fixed ;).
It can be done at the Python level, say with something like
```
from larch.io import read_ascii
from larch.xafs import xftf
from larch.plot.wxmplot_xafsplots import plot_chik, plot_chir
from pathlib import Path
fchi = read_ascii(Path('Feff8example', 'chi.dat'))
xftf(fchi, kmin=2, kmax=18, dk=4, kweight=2, window='hanning')
plot_chik(fchi, kweight=2, show_window=True, win=1)
plot_chir(fchi, show_mag=True, show_real=True, win=2)
```
I'm also willing to admit that one way of looking at Feffit (as a standalone program, part of Ifeffit, or function in Larch) is that it basically a replacement for Feff's FF2CHI module, to sum of Feff paths to make chi(k).
So, there is also an ff2chi() function in Larch. Which is to say, that you might also be able to also do:
```
from larch.xafs import feffpath, ff2chi
# sum paths
pathlist = []
for i in range(1, 101):
fpath = Path('Feff8example', f'feff{i:04}.dat')
if fpath.exists():
this_path = feffpath(fpath, s02=0.9, e0=1.0)
pathlist.append(this_path)
sum = ff2chi(pathlist)
xftf(sum, kmin=2, kmax=18, dk=4, kweight=2, window='hanning')
plot_chik(sum, kweight=2, show_window=True, title='Sum of Paths', win=3)
plot_chir(sum, show_mag=True, show_real=True, title='Sum of Paths', win=4)
```
That should probably be put into a Jupyter notebook for the documentation ;).
________________________________
From: Bone, Sharon via Ifeffit
participants (2)
-
Bone, Sharon -
Matthew Newville