def _run_multiple(trj, mol): D_pop = list() for start_frame in np.linspace(0, 4999, num=200, dtype=np.int): end_frame = start_frame + 400 if end_frame < 5000: chunk = trj[start_frame:end_frame] print('\t\t\t...frame {} to {}'.format(start_frame, end_frame)) try: D_pop.append(calc_msd(chunk)[0]) except TypeError: import pdb pdb.set_trace() else: continue D_bar = np.mean(D_pop) D_std = np.std(D_pop) return D_bar, D_std
def _run_multiple(trj, dims): D_pop = list() msd_pop = list() for start_frame in np.linspace(0, trj.n_frames, num=200, dtype=np.int): end_frame = start_frame + 1000 if end_frame < trj.n_frames: chunk = trj[start_frame:end_frame] print('\t\t\t...frame {} to {}'.format(start_frame, end_frame)) try: D, msd, x_fit, y_fit = calc_msd(chunk, dims=dims) D_pop.append(D) msd_pop.append(msd) except TypeError: import pdb pdb.set_trace() else: continue D_bar = np.mean(D_pop) D_std = np.std(D_pop) msd_bar = np.mean(msd_pop, axis=0) return D_bar, D_std, msd_bar
def _run_overall(trj, mol): D, MSD, x_fit, y_fit = calc_msd(trj) return D, MSD