def find_mdf(df):
    """
    Finds the median destructive field for AF demag data
    Parameters
    __________
        df : dataframe of measurements
    Returns
    ______
        mdf : median destructive field
    """
    mdf_df = df[df.meas_norm <= 0.5]
    mdf_high = mdf_df.treat_ac_field_mT.values[0]
    mdf_df = df[df.meas_norm >= 0.5]
    mdf_low = mdf_df.treat_ac_field_mT.values[-1]
    mdf = int(0.5 * (mdf_high + mdf_low))
    return mdf
