def tof2evpoly(a, E0, t):
    """
    Polynomial approximation of the time-of-flight to electron volt
    conversion formula.

    **Parameters**\n
    a: 1D array
        Polynomial coefficients.
    E0: float
        Energy offset.
    t: numeric array
        Drift time of electron.

    **Return**\n
    E: numeric array
        Converted energy
    """

    odr = len(a) # Polynomial order
    a = a[::-1]
    E = 0

    for i, d in enumerate(range(1, odr+1)):
        E += a[i]*t**d
    E += E0

    return E