def addTFAsSteps(tf,RGBa,bin_edges):
    """adds a general RGBa array to transfer function as step functions.

    Parameters
    ----------
    tf : yt ColorTransferFunction
        the transfer function, already initialized
    RGBa : ndarray, shape (4,N)
        The RGBa values for each step, values between 0,1
    bin_edges : ndarray, shape (1,N+1)
        The bin edges for each RGBa value

    Returns
    -------
    tf
        modified transfer function

    """

    for i_step in range(0,len(RGBa)):
        bin_start=bin_edges[i_step]
        bin_stop=bin_edges[i_step+1]
        tf.add_step(bin_start,bin_stop,RGBa[i_step])

    return tf