def testcode(mesh):
    GRIDNUMBER = (mesh.lonNum * mesh.latNum)
    window = 5
    R = np.zeros((window, window), dtype='int32')
    center = mesh.ReverseIndex[(2, 2)]
    (current_x, current_y) = mesh.Index[center]
    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), :]
    print(R)
    for i in range(len(R)):
        print(R[i])
    for i in range(len(R)):
        print(R[i][0], R[i][1], R[i][2], R[i][3], R[i][4])
    T = R.reshape((- 1))
    print(T.tolist())
    P = T.reshape(window, window)
    print(P)
    print(R.shape)
    print(R[54][4178])
    print((np.max(R) == 3369))
    print(mesh.Index[3369])
    (x, y) = mesh.Index[3369]
    (lon, lat) = ((mesh.minLon + ((x + 0.5) * mesh.dLon)), (mesh.minLat + ((y + 0.5) * mesh.dLat)))
    print(lon, lat)
    print(mesh.lonNum, mesh.latNum)
    T = np.array(range(GRIDNUMBER))
    T = T.reshape(mesh.lonNum, mesh.latNum)
    T = np.swapaxes(T, 1, 0)
    T = T[::(- 1), :]
    print(T)
    print(T.shape)
def testcode(mesh):
    GRIDNUMBER = (mesh.lonNum * mesh.latNum)
    window = 5
    R = np.zeros((window, window), dtype='int32')
    center = mesh.ReverseIndex[(2, 2)]
    (current_x, current_y) = mesh.Index[center]
    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), :]
    print(R)
    for i in range(len(R)):
        print(R[i])
    for i in range(len(R)):
        print(R[i][0], R[i][1], R[i][2], R[i][3], R[i][4])
    T = R.reshape((- 1))
    print(T.tolist())
    P = T.reshape(window, window)
    print(P)
    print(R.shape)
    print(R[54][4178])
    print((np.max(R) == 3369))
    print(mesh.Index[3369])
    (x, y) = mesh.Index[3369]
    (lon, lat) = ((mesh.minLon + ((x + 0.5) * mesh.dLon)), (mesh.minLat + ((y + 0.5) * mesh.dLat)))
    print(lon, lat)
    print(mesh.lonNum, mesh.latNum)
    T = np.array(range(GRIDNUMBER))
    T = T.reshape(mesh.lonNum, mesh.latNum)
    T = np.swapaxes(T, 1, 0)
    T = T[::(- 1), :]
    print(T)
    print(T.shape)