def subsample(df, ith):
    """
    Returns a dataframe resampled to every ith point of the original

    Args:
        df: Pandas Dataframe containing a SMP profile
        ith: The number to grab a sample, e.g. every 100 samples
    Returns:
        new_df: Pandas dataframe subsampled to every ith sample of the original. The original index is include for each value
    """

    idx = df.groupby(df.index // ith).idxmax()['Depth (mm)']
    new_df = df.loc[idx]

    return new_df