From ea5ddf6dbf500e32dbcd46b180988603cd7b9708 Mon Sep 17 00:00:00 2001 From: Jonathan Barnoud Date: Sat, 8 Apr 2017 10:20:56 +0200 Subject: [PATCH] Use a working example for the aux reader This depends on https://github.com/MDAnalysis/mdanalysis/pull/1290 being merged! --- _posts/2017-11-11-release-0.16.0.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_posts/2017-11-11-release-0.16.0.md b/_posts/2017-11-11-release-0.16.0.md index 661154ed..6bedd3b0 100644 --- a/_posts/2017-11-11-release-0.16.0.md +++ b/_posts/2017-11-11-release-0.16.0.md @@ -57,14 +57,18 @@ auxiliary data corresponding to the current time step. {% highlight python %} import MDAnalysis as mda +from MDAnalysisTests.datafiles import PDB_sub_sol, XTC_sub_sol, XVG_BZ2 # Create your universe as usual -universe = mda.Universe(SIMULATION) -# Attach an auxiliary time serie with the name `pull_force` -universe.trajectory.add_auxiliaty('pull_force', 'md_f.xvg') +universe = mda.Universe(PDB_sub_sol, XTC_sub_sol) +# Attach an auxiliary time serie with the name `forces` +# In this example, the XVG file contains the force that applies to each atom. +universe.trajectory.add_auxiliary('forces', XVG_BZ2) # Itarete through your trajectory, the time serie is kept in sync for time_step in universe.trajectory: - print(time_step.aux.pull_force) + print(time_step.aux.forces) +# The first element of each array is the time in picoseconds. +# The next elements are the other columns of the XVG file. {% endhighlight %} @fiona-naugthon worked at offering several convenient way to iterate through your