runfile('/Users/rachita/Box/Larch/Feff_Try2/001.py', wdir='/Users/rachita/Box/Larch/Feff_Try2')
Traceback (most recent call last):
File "/Users/rachita/Box/Larch/Feff_Try2/001.py", line 27, in <module>
fit = feffit(params, dset)
File "/Users/rachita/opt/anaconda3/lib/python3.8/site-packages/xraylarch-0.9.50-py3.8.egg/larch/xafs/feffit.py", line 534, in feffit
ds.prepare_fit(params=params)
File "/Users/rachita/opt/anaconda3/lib/python3.8/site-packages/xraylarch-0.9.50-py3.8.egg/larch/xafs/feffit.py", line 265, in prepare_fit
ikmax = int(1.01 + max(self.data.k)/trans.kstep)
AttributeError: 'AthenaGroup' object has no attribute ‘k’ #tried this with xdi format data and got the same error
Below is the script -
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from larch.fitting import param_group, Parameter
from larch.xafs import feffpath, feffit_dataset, feffit_transform, feffit, feffit_report
data = read_xdi('cu_metal_rt.xdi’) #I tried importing Athena project file too
path1 = feffpath('feff0001.dat', s02='amplitude', e0='del_e0',
sigma2='sigma2', deltar='del_r')
trans = feffit_transform(kmin=3, kmax=16, kw=(2,1,3),
dk=1, window='hanning', rmin=1.7, rmax=3.1)
params = param_group(amplitude= Parameter(1, vary=True),
del_e0 = Parameter(1e-7, vary=True),
del_r = Parameter(1e-7, vary=True),
sigma2 = Parameter(0.003, vary=True))
dset = feffit_dataset(data=data, pathlist=[path1], transform=trans)
fit = feffit(params, dset)
print(feffit_report(fit))