def spline_eval(kraw, mu, knots, coefs, order, kout):
    bkg = splev(kraw, [knots, coefs, order])
    chi = UnivariateSpline(kraw, (mu-bkg), s=0)(kout)
    return bkg, chi
eval bkg(kraw) and chi(k) for knots, coefs, order
dataset/ETHPy150Open xraypy/xraylarch/plugins/xafs/autobk.py/spline_eval