def getDynamicMeshMobmapR(R, trajFileName, dynamicFileName, meshcode_level):
    Timestamps = getTimestamps(trajFileName)
    print('getDynamicMesh Count Ended : ', time.ctime())
    with open(dynamicFileName, 'w') as wf:
        wf.write('@dynamic-mesh\n')
        wf.write(('@use-mesh-code,' + str(meshcode_level)))
        for i in range(len(R)):
            timestamp = Timestamps[i]
            for key in R[i]:
                meshcode = key
                meshpop = R[i][meshcode]
                wf.write((','.join([timestamp, meshcode, str(meshpop)]) + '\n'))
    print('getDynamicMesh Ended : ', time.ctime())
def getDynamicMeshMobmapR(R, trajFileName, dynamicFileName, meshcode_level):
    Timestamps = getTimestamps(trajFileName)
    print('getDynamicMesh Count Ended : ', time.ctime())
    with open(dynamicFileName, 'w') as wf:
        wf.write('@dynamic-mesh\n')
        wf.write(('@use-mesh-code,' + str(meshcode_level)))
        for i in range(len(R)):
            timestamp = Timestamps[i]
            for key in R[i]:
                meshcode = key
                meshpop = R[i][meshcode]
                wf.write((','.join([timestamp, meshcode, str(meshpop)]) + '\n'))
    print('getDynamicMesh Ended : ', time.ctime())