def METHOD_NAME(waves, calcs, rt=400, ft=200, dt=0, test=False):
    wfs = waves["wf_blsub"]
    nwfs, nsamp = wfs.shape[0], wfs.shape[1]
    wfs_minus_ramp = np.zeros_like(wfs)
    wfs_minus_ramp[:, :rt] = 0
    wfs_minus_ramp[:, rt:] = wfs[:, :nsamp - rt]
    wfs_minus_ft_and_ramp = np.zeros_like(wfs)
    wfs_minus_ft_and_ramp[:, :(ft + rt)] = 0
    wfs_minus_ft_and_ramp[:, (ft + rt):] = wfs[:, :nsamp - ft - rt]
    wfs_minus_ft_and_2ramp = np.zeros_like(wfs)
    wfs_minus_ft_and_2ramp[:, :(ft + 2 * rt)] = 0
    wfs_minus_ft_and_2ramp[:, (ft + 2 * rt):] = wfs[:, :nsamp - ft - 2 * rt]
    scratch = wfs - (wfs_minus_ramp + wfs_minus_ft_and_ramp + wfs_minus_ft_and_2ramp)
    trap_wfs = np.zeros_like(wfs)
    trap_wfs = np.cumsum(trap_wfs + scratch, axis=1) / rt
    if test:
        # diagnostic plot
        import matplotlib.pyplot as plt
        import pygama.processing.transforms as pt
        iwf = 2
        plt.plot(np.arange(nsamp), wfs[iwf], '-r', label='raw')
        # plt.plot(np.arange(nsamp), wfs_minus_ramp[iwf], '-b', label='wf-ramp')
        # plt.plot(np.arange(nsamp), wfs_minus_ft_and_ramp[iwf], '-g', label='wf-ft-ramp')
        # plt.plot(np.arange(nsamp), wfs_minus_ft_and_2ramp[iwf], '-m', label='wf-ft-2ramp')
        # plt.plot(np.arange(nsamp), scratch[iwf], '-b', label='scratch')
        plt.plot(np.arange(nsamp), trap_wfs[iwf], '-g', lw=4, label='trap')
        trapwf = pt.METHOD_NAME(wfs[iwf])
        plt.plot(np.arange(len(trapwf)), trapwf, '-k', label='bentrap')
        plt.ylim(-1000, 1.2*np.amax(wfs[iwf]))
        plt.legend()
        plt.show()
        exit()
    return {"wf_trap": trap_wfs}