
read_data(file = ../data/cu.xmu, label = 'energy xmu', group = data)

spline(energy= data.energy, xmu= data.xmu, kweight=1,rbkg=1.1)

unguess 
guess  s02   = 1.
guess  e0    = 1.
guess  ss2   = 0.002
guess  dr    = 0.001

path(index  = 1, 
     feff   = ../feff/feffcu01.dat, 
     label  = "Cu metal first neighbor", 
     s02    = s02, 
     sigma2 = ss2,
     delr   = dr, 
     e0     = e0 )

kmin = 2, kmax=17, kweight=2, dk1 = 3, dk2=3
rmin = 1.8, rmax =2.6

feffit(chi = data.chi, k=data.k,group = fit, 1, fit_mode='rm')

show @variables, chi_square, r_factor


newplot( fit.r,  fit.chir_im, xmax=rmax, xmin=rmin)
plot(data.r, data.chir_im)
plot( fit.r,  fit.chir_mag)
plot(data.r, data.chir_mag)
pause

newplot(data.r, data.chir_re-fit.chir_re, xmax=rmax, xmin=rmin)
plot(data.r, data.chir_mag-fit.chir_mag)
plot(data.r, data.chir_mag)
