Skip to content

Instantly share code, notes, and snippets.

@rmcgibbo
Created June 25, 2013 06:56
Show Gist options
  • Save rmcgibbo/5856507 to your computer and use it in GitHub Desktop.
Save rmcgibbo/5856507 to your computer and use it in GitHub Desktop.
import mdtraj as md
import numpy as np
n_frames = 100
coords = np.random.multivariate_normal(mean=[0, 0, 0], cov=[[2, 1, 0], [0, 1, 0], [0 ,0, 1]], size=n_frames)
coords = np.reshape(coords, (n_frames, 1, 3))
with md.XTCTrajectoryFile('output.xtc', 'w') as f:
f.write(coords)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment