docs: def trajectory(start=None, stop=None, step=None):
      '''Useful command to iterate on the trajectory frames by time (in
      ns). It is meant to be used in a for loop::
  
          for i in trajectory(0, 10, 0.1):
              coords = current_frame()
              t = current_time()
              # Do something
  
      The previous snippet will stop at every frame from 0 to 10 ns with
      a step of 0.1 ns.
  
      '''
      import numpy as np
      from PyQt4 import QtGui
  
      times = np.array(current_frame_times()) / 1000
  
      if start is None:
          start = 0
  
      if stop is None:
          stop = times[-1]
  
      start = times.searchsorted(start)
      stop = times.searchsorted(stop)
  
      nsteps = (times[stop] - times[start])/(step)
      step = int((stop - start)/nsteps) or 1
  
      sl = slice(start, stop, step)
      for i in range(*sl.indices(current_nframes())):
          viewer.traj_controls.goto_frame(i)
          yield i
          QtGui.qApp.processEvents()