tfep.io.dataset.traj.get_subsampled_indices

tfep.io.dataset.traj.get_subsampled_indices(dt, stop, start=0, step=None, n_frames=None, t0=0.0)[source]

Subsamples the trajectory at a constant time interval after discarding an initial equilibration.

This function returns the indices of the trajectory frames that must be selected for subsampling.

start, stop, and step can be given either as number of frames or in units of time as pint.Quantity. If the latter, the initial time of the simulation t0 is taken into account. Note that this might not be zero if, for example, the simulation was resumed. For example, if start is 2 ns and the simulation starts at 1 ns, only the first ns of data is discarded.

Parameters:
  • start (int or pint.Quantity) – The first frame to include in the dataset specified either as a frame index or in simulation time. If not provided, the subsampling starts from the first frame in the trajectory.

  • stop (int or pint.Quantity) – The last frame to include in the dataset specified either as a frame index or in simulation time.

  • step (int or pint.Quantity, optional) – The step used for subsampling specified either as a frame index or or in simulation time. Only one between step and n_frames may be passed.

  • n_frames (int, optional) – The total number of frames to include in the dataset. If this is passed, the step will automatically be determined to satisfy this requirement. Note that in this case the obtained samples in the dataset might not be equally spaced if n_frames is not an exact divisor of the number of frames. Only one between step and n_frames may be passed.

  • t0 (pint.Quantity, optional) – The time of the first frame in the trajectory to subsamples. This might not be 0.0 if, for example, the simulation was resumed.

Returns:

trajectory_indices – The indices of the trajectory frames to use for subsampling.

Return type:

numpy.ndarray