Ejemplo n.º 1
0
##############################################################################
# Code
##############################################################################

run_name = 'run9'
data_path = '/home/shenglan/MD_simulations/water_box/cubic_2nm_run9'
traj = md.load_trr(data_path+'/nvt-pr.trr', top = data_path+'/water-sol.gro')
print ('here is some info about the trajectory we are looking at:')
print traj
ws = WaterStats(traj,run_name)
cut_off = 0.5

tic = time.clock()
for this_frame in range(ws.n_frames):
    tic_loop = time.clock()
    print 'finding tthds for frame %d' % this_frame
    if str(this_frame) in ws.nearest_tthds:
        pass
    else:
        tthds = ws.make_nearest_nb_tthds(cut_off,this_frame)
        ws.nearest_tthds.create_dataset(str(this_frame),data = tthds)
    toc_loop = time.clock()
    print('Total time for this frame: %.2f' %(toc_loop-tic_loop)) 

toc = time.clock()
print('Total time: %.2f' %(toc-tic))

ws.all_tthds.close()
ws.nearest_tthds.close()
Ejemplo n.º 2
0
##############################################################################
# Code
##############################################################################

run_name = 'run9'
data_path = '/home/shenglan/MD_simulations/water_box/cubic_2nm_run9'
traj = md.load_trr(data_path + '/nvt-pr.trr', top=data_path + '/water-sol.gro')
print('here is some info about the trajectory we are looking at:')
print traj
ws = WaterStats(traj, run_name)
cut_off = 0.5

tic = time.clock()
for this_frame in range(ws.n_frames):
    tic_loop = time.clock()
    print 'finding tthds for frame %d' % this_frame
    if str(this_frame) in ws.nearest_tthds:
        pass
    else:
        tthds = ws.make_nearest_nb_tthds(cut_off, this_frame)
        ws.nearest_tthds.create_dataset(str(this_frame), data=tthds)
    toc_loop = time.clock()
    print('Total time for this frame: %.2f' % (toc_loop - tic_loop))

toc = time.clock()
print('Total time: %.2f' % (toc - tic))

ws.all_tthds.close()
ws.nearest_tthds.close()