def getINDEX(mesh, gTrajFileName):
    GRIDNUMBER = (mesh.lonNum * mesh.latNum)
    print('getTrajectoryINDEX Started : ', time.ctime())
    Timestamps = getTimestamps(gTrajFileName)
    print('timestamps...', len(Timestamps))
    TDB = loadGTrajectory(gTrajFileName)
    INDEX = []
    for i in range(len(Timestamps)):
        INDEX.append([])
        for G in range(GRIDNUMBER):
            INDEX[i].append(set())
    for tid in TDB:
        traj = TDB[tid]
        for i in range(len(traj)):
            HH = i
            if (traj[i] == 'None'):
                pass
            else:
                gid = int(traj[i])
                INDEX[HH][gid].add(tid)
    return INDEX
def getINDEX(mesh, gTrajFileName):
    GRIDNUMBER = (mesh.lonNum * mesh.latNum)
    print('getTrajectoryINDEX Started : ', time.ctime())
    Timestamps = getTimestamps(gTrajFileName)
    print('timestamps...', len(Timestamps))
    TDB = loadGTrajectory(gTrajFileName)
    INDEX = []
    for i in range(len(Timestamps)):
        INDEX.append([])
        for G in range(GRIDNUMBER):
            INDEX[i].append(set())
    for tid in TDB:
        traj = TDB[tid]
        for i in range(len(traj)):
            HH = i
            if (traj[i] == 'None'):
                pass
            else:
                gid = int(traj[i])
                INDEX[HH][gid].add(tid)
    return INDEX