def OpenFace(openface_features, PID, EXP):
    """
    Tidy up OpenFace features in pandas data.frame to be stored in sqlite
    database:
    - Participant and experiment identifiers are added as columns
    - Underscores in column names are removed, because sqlite does not like
        underscores in column names.
    - Only column names with 'AU' in the column name are considered relevant
      features and kept, the rest is removed.

    Parameters
    ----------
    video_features : pandas.core.frame.DataFrame
        Data frame with columns participant_id (str), experiment_id (str),
        timestamp (datetime64), and columns for the OpenFace derived
        video features:
        AU01r (float64), AU02r (float64), AU01c (float64), AU02c (float64)
    PID : str
        Participant identifier
    EXP : str
        Experiment identifier.

    Returns
    -------
    video_features : pandas.core.frame.DataFrame
        New data frame

    """

    # tidy up data frame:
    filter_col = [col for col in openface_features if col.startswith('AU')]
    filter_col.insert(0,'time')
    filter_col.insert(0,'participant_id')
    filter_col.insert(0,'experiment_id')
    openface_features['participant_id'] = PID
    openface_features['experiment_id'] = EXP
    openface_features = openface_features[filter_col]
    openface_features.columns = openface_features.columns.str.replace('_', '')
    openface_features = openface_features.rename(columns = {'experimentid':'experiment_id'})
    openface_features = openface_features.rename(columns = {'participantid':'participant_id'})
    return openface_features