def mass_halliday(df):
    """
    Returns a calculated meteor mass as derived by Halliday and the error in this value. This scheme uses a constant tau
    of 0.04 for meteors with velocities lower than or equal to 36km/s. For velocities greater than this a velocity-
    dependant relationship is used.

    :param df: dataframe containing all processed DAF data
    :return:
    """
    intg_luminosity = 10 ** (-0.39026606 * df['avg_abs_mag'] + 1.96769668
        ) * 2.5
    vel_1 = df.loc[df['vel_avg'] <= 36000, 'vel_avg']
    vel_2 = df.loc[df['vel_avg'] > 36000, 'vel_avg']
    tau_1 = 0.04
    tau_2 = 0.069 * (36 / (vel_2 / 1000)) ** 2
    mass_1 = 2.0 / (tau_1 * vel_1 ** 2) * intg_luminosity
    mass_2 = 2.0 / (tau_2 * vel_2 ** 2) * intg_luminosity
    mass_err_1 = abs(4.0 * tau_1 ** -1 * vel_1 ** -3 * intg_luminosity
        ) * 1 + abs(2.0 * tau_1 ** -1 * vel_1 ** -2 * df['intg_luminosity_err']
        )
    mass_err_2 = abs(4.0 * tau_2 ** -1 * vel_2 ** -3 * intg_luminosity
        ) * 1 + abs(2.0 * tau_2 ** -1 * vel_2 ** -2 * df['intg_luminosity_err']
        )
    mass = mass_1.fillna(mass_2)
    mass_err = mass_err_1.fillna(mass_err_2)
    return mass, mass_err
