import os ############################################################################## # Code ############################################################################## run_name = "run4" data_path = os.getcwd() + "/data" traj = md.load_trr(data_path + "/nvt-pr_" + run_name + ".trr", top=data_path + "/water-sol_" + run_name + ".gro") print ("here is some info about the trajectory we are looking at:") print traj ws = WaterStats(traj, run_name) cut_off = 0.5 for this_frame in range(ws.n_frames): if str(this_frame) in ws.all_tthds: pass else: tthds = [] for this_water in ws.water_inds: tthds.extend(ws.make_tthd(this_water, cut_off, this_frame)) ws.all_tthds.create_dataset(str(this_frame), data=tthds) # print len(tthds) # print tthds[0][0] # ws.all_tthds['1'][:]= tthds ws.all_tthds.close()
import numpy as np import os ############################################################################## # Code ############################################################################## run_name = 'run4' data_path = os.getcwd() + '/data' traj = md.load_trr(data_path + '/nvt-pr_' + run_name + '.trr', top=data_path + '/water-sol_' + run_name + '.gro') print('here is some info about the trajectory we are looking at:') print traj ws = WaterStats(traj, run_name) cut_off = 0.5 for this_frame in range(ws.n_frames): if str(this_frame) in ws.all_tthds: pass else: tthds = [] for this_water in ws.water_inds: tthds.extend(ws.make_tthd(this_water, cut_off, this_frame)) ws.all_tthds.create_dataset(str(this_frame), data=tthds) # print len(tthds) # print tthds[0][0] #ws.all_tthds['1'][:]= tthds ws.all_tthds.close()