def getGridImageIndex(mesh, window=15):
    GRIDNUMBER = (mesh.lonNum * mesh.latNum)
    IMG = []
    for g in range(GRIDNUMBER):
        R = np.zeros((window, window), dtype='int32')
        (current_x, current_y) = mesh.Index[g]
        start = (0 - (window // 2))
        end = (window + start)
        for (i, dx) in enumerate(list(range(start, end))):
            for (j, dy) in enumerate(list(range(start, end))):
                x = (current_x + dx)
                y = (current_y + dy)
                if mesh.inMesh(x, y):
                    grid = mesh.ReverseIndex[(x, y)]
                    R[j][i] = grid
                else:
                    R[j][i] = (- 1)
        R = R[::(- 1), :]
        IMG.append(R)
    return IMG
def getGridImageIndex(mesh, window=15):
    GRIDNUMBER = (mesh.lonNum * mesh.latNum)
    IMG = []
    for g in range(GRIDNUMBER):
        R = np.zeros((window, window), dtype='int32')
        (current_x, current_y) = mesh.Index[g]
        start = (0 - (window // 2))
        end = (window + start)
        for (i, dx) in enumerate(list(range(start, end))):
            for (j, dy) in enumerate(list(range(start, end))):
                x = (current_x + dx)
                y = (current_y + dy)
                if mesh.inMesh(x, y):
                    grid = mesh.ReverseIndex[(x, y)]
                    R[j][i] = grid
                else:
                    R[j][i] = (- 1)
        R = R[::(- 1), :]
        IMG.append(R)
    return IMG