def num_neighbours(lag=1):
    """
    Calculate number of neigbour pixels for a given lag.

    Parameters
    ----------
    lag : int
        Lag distance, defaults to 1.

    Returns
    -------
    int
        Number of neighbours
    """
    win_size = 2 * lag + 1
    neighbours = win_size**2 - (2 * (lag - 1) + 1)**2

    return neighbours