def eps_water(f_Hz, T_K):
    """Calculate the dielectric permitiviy of water

    Formulas taken from dielectric permittivity of liquid water
    without salt according to
    Liebe et al. 1991 Int. J. IR+mm Waves 12(12), 659-675

    Based on MATLAB code by Christian Mätzler, June 2002
    Cosmetic changes by Christian Chwala, August 2012

    Parameters
    ----------
    f_Hz : array-like
        Frequency in Hz
    T_K : float
        Temperature in Kelvin

    Returns
    -------

    eps : np.complex

    """

    f_GHz = f_Hz * 1e-9

    teta = 1 - 300.0 / T_K
    e0 = 77.66 - 103.3 * teta
    e1 = 0.0671 * e0
    f1 = 20.2 + 146.4 * teta + 316 * teta * teta
    e2 = 3.52 + 7.52 * teta
    # Note that "Liebe et al 1993, Propagation Modeling of Moist Air and
    # Suspended Water/Ice Particles at Frequencies Below 1000 GHz,
    # AGARD Conference Proc. 542" uses just e2 = 3.52. For our frequency
    # and temperature range the difference is negligible, though.

    f2 = 39.8 * f1
    eps = e2 + (e1 - e2) / (1 - 1j * f_GHz / f2) + (e0 - e1) / (1 - 1j * f_GHz / f1)
    return eps