From 7343dd3fc9b3dd19c360592853949d8a3631d001 Mon Sep 17 00:00:00 2001 From: John Detlefs Date: Wed, 27 Jul 2016 16:49:59 -0700 Subject: [PATCH] g# This is a combination of 3 commits. Everything working Fixed logic error in code Removed printing --- package/MDAnalysis/coordinates/src/dcd.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/package/MDAnalysis/coordinates/src/dcd.c b/package/MDAnalysis/coordinates/src/dcd.c index f27068200dc..4a19b6c3ed7 100644 --- a/package/MDAnalysis/coordinates/src/dcd.c +++ b/package/MDAnalysis/coordinates/src/dcd.c @@ -531,15 +531,14 @@ __read_timeseries(PyObject *self, PyObject *args) goto error; } /*Should actually be number of frames, not true yet*/ - remaining_frames = stop; + remaining_frames = stop-start; for (i=0;i 1) { + if (skip > 1 && i>0) { // Figure out how many steps to skip - numskip = skip; + numskip = skip -1; if(remaining_frames < numskip){ numskip = 1; } - printf("%d numskip, %d skip %d stop %d setsread %d n_frames %d i %d remaining_frames \n", numskip, skip, stop, dcd->setsread, n_frames, i, remaining_frames); rc = skip_dcdstep(dcd->fd, dcd->natoms, dcd->nfixed, dcd->charmm, numskip); if (rc < 0) { // return an exception @@ -547,13 +546,13 @@ __read_timeseries(PyObject *self, PyObject *args) goto error; } } + dcd->setsread += numskip; //now read from subset rc = read_dcdsubset(dcd->fd, dcd->natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd->nfixed, dcd->first, dcd->freeind, dcd->fixedcoords, dcd->reverse, dcd->charmm); - dcd->first = 0; - dcd->setsread += numskip; + dcd->setsread += 1; remaining_frames = stop - dcd->setsread; if (rc < 0) { // return an exception