def fixed_window_rolling_average(df, thickness, dx=0.1, bounds=[0., 28.0]):
    """
    Calculates a rolling average using a window of fixed width.

    Parameters
    ----------
    df : pandas.DataFrame object
        DataFrame containing splitting results.
    thickness : float
        Size of window, in km.
    dx : float, optional
        Size of increment for rolling average, in km. Default 0.1 km.
    bounds : list of float, optional
        Min/max depth to perform rolling average over, in km. Default 0-28 km.

    Returns
    -------
    depth : list of float
        Depths for each of the assigned values.
    mean : list of float
        Mean values for the rolling window, assigned to the midpoint.
    median : list of float
        Median values for the rolling window, assigned to the midpoint.
    std : list of float
        Standard deviation values for the rolling window, assigned to the
        midpoint.

    """

    depth, amean, median, std = [], [], [], []

    top, max_depth = bounds
    bottom = top + thickness
    while bottom <= max_depth:
        depth.append(top + thickness / 2)
        vals = df[(df["depthkm"] >= top) & (df["depthkm"] <= bottom)]["tlag"]
        amean.append(vals.mean())
        median.append(vals.median())
        std.append(vals.std())

        top += dx
        bottom += dx
    
    return depth, amean, median, std