@ValidateLarchPlugin
def xrf_background(energy, counts=None, group=None, width=4,
                   compress=2, exponent=2, slope=None,
                   _larch=None):
    if isLarchMCAGroup(energy):
        group  = energy
        counts = group.counts
        energy = group.energy
    if slope is None:
        slope = (energy[-1] - energy[0])/len(energy)

    xbgr = XRFBackground(counts, width=width, compress=compress,
                         exponent=exponent, slope=slope)

    if group is not None:
        group.bgr = xbgr.bgr
        group.bgr_info = xbgr.parinfo
fit background for XRF spectra.  Arguments:
dataset/ETHPy150Open xraypy/xraylarch/plugins/xrf/xrf_bgr.py/xrf_background