def box_filter(df, ll_corner, ur_corner):
    """
    Filter a summary file for event within a geographical box.

    Parameters
    ----------
    df : pandas DataFrame
        Summary of SWS measurements
    ll_corner : float, array
        Coordinates of lower left corner of box.
    ur_corner : float, array
        Coordinates of upper right corner of box.

    Returns
    -------
    out : pandas DataFrame
        Filtered summary file.

    """

    # Filter by longitude
    out = df[(df["evlo"] >= ll_corner[0]) & (df["evlo"] <= ur_corner[0])]

    # Filter by latitude
    out = out[(out["evla"] >= ll_corner[1]) & (out["evlo"] <= ur_corner[1])]

    # Filter by depth
    out = out[(out["depthkm"] >= ll_corner[2]) & (out["depthkm"] <= ur_corner[2])]

    return out