def make_window(x, y, xmin, ymin, windowsize):
    """
    Create a window for writing a child tile to a parent output tif
    """
    if x < xmin or y < ymin:
        raise ValueError("Indices can't be smaller than origin")
    row = (y - ymin) * windowsize
    col = (x - xmin) * windowsize

    return (
            (row, row + windowsize),
            (col, col + windowsize)
        )