@staticmethod
def run(config, input, output):
    if ('mbxanes' in output):
        w = np.array(input.get('xanes_cfavg')[0])
        mu0 = np.array(input.get('xanes_cfavg')[1])
        wsf = np.flip(((- 1.0) * np.array(input.get('spectralFunction')[0])))
        sf = np.flip(np.array(input.get('spectralFunction')[1]))
        min_diff = np.amin(np.ediff1d(w))
        min_diff = min(min_diff, np.amin(np.ediff1d(wsf)))
        mu0_cs = CubicSpline(w, mu0)
        spfcn_cs = CubicSpline(wsf, sf)
        w_terp = np.arange(w[0], w[(- 1)], min_diff)
        wsf_terp = np.arange(wsf[0], wsf[(- 1)], min_diff)
        mu0_terp = mu0_cs(w_terp)
        spfcn_terp = spfcn_cs(wsf_terp)
        mu_mb = (convolve(mu0_terp, spfcn_terp, mode='full') * min_diff)
        if ('mbconv.extra_broadening' in input):
            gam = input['mbconv.extra_broadening'][0][0]
            A_br = (((gam / np.pi) * 1.0) / ((wsf_terp ** 2) + (gam ** 2)))
            mu_mb = (np.convolve(mu_mb, A_br, mode='same') * min_diff)
        scale = (((w_terp[(- 1)] - w_terp[0]) + wsf_terp[(- 1)]) - wsf_terp[0])
        first = (w_terp[0] + wsf_terp[0])
        w_terp = np.linspace(0.0, scale, mu_mb.size)
        w_terp = (w_terp + first)
        mu0_terp = mu0_cs(w_terp)
        output['mbxanes'] = [w_terp, mu_mb]
        np.savetxt('mbxanes.dat', np.array([w_terp, mu_mb, mu0_terp]).transpose())
@staticmethod
def run(config, input, output):
    if ('mbxanes' in output):
        w = np.array(input.get('xanes_cfavg')[0])
        mu0 = np.array(input.get('xanes_cfavg')[1])
        wsf = np.flip(((- 1.0) * np.array(input.get('spectralFunction')[0])))
        sf = np.flip(np.array(input.get('spectralFunction')[1]))
        min_diff = np.amin(np.ediff1d(w))
        min_diff = min(min_diff, np.amin(np.ediff1d(wsf)))
        mu0_cs = CubicSpline(w, mu0)
        spfcn_cs = CubicSpline(wsf, sf)
        w_terp = np.arange(w[0], w[(- 1)], min_diff)
        wsf_terp = np.arange(wsf[0], wsf[(- 1)], min_diff)
        mu0_terp = mu0_cs(w_terp)
        spfcn_terp = spfcn_cs(wsf_terp)
        mu_mb = (convolve(mu0_terp, spfcn_terp, mode='full') * min_diff)
        if ('mbconv.extra_broadening' in input):
            gam = input['mbconv.extra_broadening'][0][0]
            A_br = (((gam / np.pi) * 1.0) / ((wsf_terp ** 2) + (gam ** 2)))
            mu_mb = (np.convolve(mu_mb, A_br, mode='same') * min_diff)
        scale = (((w_terp[(- 1)] - w_terp[0]) + wsf_terp[(- 1)]) - wsf_terp[0])
        first = (w_terp[0] + wsf_terp[0])
        w_terp = np.linspace(0.0, scale, mu_mb.size)
        w_terp = (w_terp + first)
        mu0_terp = mu0_cs(w_terp)
        output['mbxanes'] = [w_terp, mu_mb]
        np.savetxt('mbxanes.dat', np.array([w_terp, mu_mb, mu0_terp]).transpose())