Skip to content

Commit

Permalink
g# This is a combination of 3 commits.
Browse files Browse the repository at this point in the history
Everything working

Fixed logic error in code

Removed printing
  • Loading branch information
jdetle committed Jul 27, 2016
1 parent b7b58ad commit 7343dd3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions package/MDAnalysis/coordinates/src/dcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,29 +531,28 @@ __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<n_frames;i++) {
if (skip > 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
PyErr_SetString(PyExc_IOError, "Error skipping frame from DCD file");
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
Expand Down

0 comments on commit 7343dd3

Please sign in to comment.