## examples/xafs/doc_autobk3.lar
fname = '../xafsdata/scorodite_as_xafs.001'
title = 'FeAsSO4  (scorodite)'
dat = read_ascii(fname)
dat.mu    = ln(dat.i0/dat.i1)

autobk(dat.energy, dat.mu, rbkg=1.0, group=dat, clamp_hi=0)
dat.chi0 = dat.chi * dat.k**2
dat.bkg0 = dat.bkg

autobk(dat.energy, dat.mu, rbkg=1.0, group=dat, clamp_hi=10)
dat.chi10 = dat.chi * dat.k**2
dat.bkg10 = dat.bkg

autobk(dat.energy, dat.mu, rbkg=1.0, group=dat, clamp_hi=50)
dat.chi50 = dat.chi * dat.k**2
dat.bkg50 = dat.bkg

newplot(dat.k, dat.chi0, label='clamp_hi=0', show_legend=True,
        xlabel=r'$k \rm\, (\AA^{-1})$',  ylabel=r'$k^2\chi(k)$',
        title='Effect of clamp_hi')

plot(dat.k, dat.chi10, label='clamp_hi=10', show_legend=True)
plot(dat.k, dat.chi50, label='clamp_hi=50', show_legend=True)

## end of examples/xafs/doc_autobk3.lar
