import time
doplot = False
timer = debugtimer()
t0 = time.time()
n = 100
for i in range(n):
    cu = read_ascii('../xafsdata/cu_metal_rt.xdi')

    timer.add('read data file')
    cu.mu = cu.mutrans
    autobk(cu, rbkg=0.80, calc_uncertainties=False)
    timer.add('autobk done')

    xftf(cu.k, cu.chi, kmin=1, kmax=21, dk=2, window='hanning',  kweight=2, group=cu, rmax_out=20)
    timer.add('xftf done')

    xftr(cu.r, cu.chir, rmin=0.1, rmax=4, qmax_out=20, dr=0, window='hanning', group=cu)
    timer.add('xftr done')

    if doplot:
        plot_bkg(cu)
        plot_chik(cu, kweigt=2, win=2)
        plot_chir(cu, ramx=15, win=3)
    #endif
#endfor

timer.show_report()

# show(cu)

# print( 'Ran %i processing steps in % .4f seconds' % (n, time.time() - t0))
